Sha256: 72063c482a7f4805c9c7020724e8c8c23332d7f280f5f7127080f6d118e502ba

Contents?: true

Size: 1.75 KB

Versions: 15

Compression:

Stored size: 1.75 KB

Contents

/**
 * Copyright 2014 Red Hat, Inc.
 *
 * This software is licensed to you under the GNU General Public
 * License as published by the Free Software Foundation; either version
 * 2 of the License (GPLv2) or (at your option) any later version.
 * There is NO WARRANTY for this software, express or implied,
 * including the implied warranties of MERCHANTABILITY,
 * NON-INFRINGEMENT, or FITNESS FOR A PARTICULAR PURPOSE. You should
 * have received a copy of GPLv2 along with this software; if not, see
 * http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt.
 */


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

15 entries across 15 versions & 1 rubygems

Version Path
bastion-0.3.3 test/components/bst-container-scroll.directive.test.js
bastion-1.0.1 test/components/bst-container-scroll.directive.test.js
bastion-0.3.2 test/components/bst-container-scroll.directive.test.js
bastion-1.0.0 test/components/bst-container-scroll.directive.test.js
bastion-0.3.1 test/components/bst-container-scroll.directive.test.js
bastion-0.3.0 test/components/bst-container-scroll.directive.test.js
bastion-0.2.9 test/components/bst-container-scroll.directive.test.js
bastion-0.2.8 test/components/bst-container-scroll.directive.test.js
bastion-0.2.7 test/components/bst-container-scroll.directive.test.js
bastion-0.2.6 test/components/bst-container-scroll.directive.test.js
bastion-0.2.5 test/components/bst-container-scroll.directive.test.js
bastion-0.2.3 test/components/bst-container-scroll.directive.test.js
bastion-0.2.2 test/components/bst-container-scroll.directive.test.js
bastion-0.2.1 test/components/bst-container-scroll.directive.test.js
bastion-0.2.0 test/components/bst-container-scroll.directive.test.js