Sha256: 87f68163c6f990d81bd76c13157f2118b91461e663c4cb2f380ca81bd7ea75d7

Contents?: true

Size: 1.58 KB

Versions: 15

Compression:

Stored size: 1.58 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: bstAlert', function() {
    var scope,
        compile,
        element,
        elementScope;

    beforeEach(module('Bastion.components', 'components/views/bst-alert.html'));

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

    beforeEach(function() {
        element = angular.element('<div bst-alert="info"></div>');

        compile(element)(scope);
        scope.$digest();

        elementScope = element.isolateScope();
    });

    it("should display an alert", function() {
        scope.successMessages = ['hello'];
        scope.$digest();

        expect(element.find('.alert').length).toBe(1);
    });

    it("should display a close icon if a close function is provided", function () {
        element = angular.element('<div bst-alert="info" close="close()"></div>');

        compile(element)(scope);
        scope.$digest();
        elementScope = element.isolateScope();

        expect(elementScope.closeable).toBe(true);
    });
});

Version data entries

15 entries across 15 versions & 1 rubygems

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