Sha256: 75e74d013325b64187954eaae9ebcd492e9b8692bcaec9280a5da8e88ca2d7e8

Contents?: true

Size: 1.19 KB

Versions: 11

Compression:

Stored size: 1.19 KB

Contents

describe('Directive: bstContainerScroll', function() {
    var scope,
        compile,
        window,
        tableElement;

    beforeEach(module('Bastion.components'));

    beforeEach(inject(function(_$compile_, _$rootScope_, _$window_) {
        compile = _$compile_;
        scope = _$rootScope_;
        window = _$window_;
    }));

    beforeEach(function() {
        tableElement = angular.element(
            '<div bst-container-scroll>' +
              '<table>' +
                '<thead>' +
                  '<tr><th>Column 1</th></tr>' +
                '</thead>' +
                '<tbody>' +
                  '<tr>' +
                    '<td>Row 1</td>' +
                 '</tr>' +
                '</tbody>' +
              '</table>' +
            '</div>');

        compile(tableElement)(scope);
        scope.$digest();
    });

    it("should adjust the table height on window resize", function() {
        var table = tableElement.find('table'),
            windowElement = angular.element(window);

        windowElement.height('100px');
        windowElement.trigger('resize');

        expect(tableElement.height()).toEqual(windowElement.height() - tableElement.offset().top);
    });
});

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
bastion-3.2.0 test/components/bst-container-scroll.directive.test.js
bastion-3.1.0 test/components/bst-container-scroll.directive.test.js
bastion-3.0.1 test/components/bst-container-scroll.directive.test.js
bastion-3.0.0 test/components/bst-container-scroll.directive.test.js
bastion-2.1.0 test/components/bst-container-scroll.directive.test.js
bastion-2.0.4 test/components/bst-container-scroll.directive.test.js
bastion-2.0.3 test/components/bst-container-scroll.directive.test.js
bastion-2.0.2 test/components/bst-container-scroll.directive.test.js
bastion-2.0.1 test/components/bst-container-scroll.directive.test.js
bastion-2.0.0 test/components/bst-container-scroll.directive.test.js
bastion-1.0.2 test/components/bst-container-scroll.directive.test.js