~mpontillo/maas/migrate-dns-settings-1.8

« back to all changes in this revision

Viewing changes to src/maasserver/static/js/angular/directives/tests/test_sticky_header.js

  • Committer: MAAS Lander
  • Author(s): Blake Rouse
  • Date: 2015-06-03 14:18:36 UTC
  • mfrom: (3980.2.1 fix-1461258)
  • Revision ID: maas_lander-20150603141836-z1fayhojbfibb7v9
[r=andreserl][bug=1461258][author=blake-rouse] Don't initialize the header height to the current value of the element. Reset the padding-top on destroy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
71
71
            };
72
72
            setTimeout(checkAndIncrement, 100);
73
73
        });
 
74
 
 
75
    it("removes padding-top on $destroy", function(done) {
 
76
        var directive = compileDirective();
 
77
        var body = directive.find("div.maas-wrapper");
 
78
        var header = directive.find("header");
 
79
        var height = makeInteger(100, 3000);
 
80
        header.height(height);
 
81
        setTimeout(function() {
 
82
            expect(body.css("padding-top")).toBe(height + 20 + "px");
 
83
            $scope.$destroy();
 
84
            expect(body.css("padding-top")).toBe('');
 
85
            done();
 
86
        }, 100);
 
87
    });
74
88
});