Sha256: ee1dfeb2432519844e2569d3d729056f3c96b87f955c9bf3504a62c7f4bcd7ba

Contents?: true

Size: 1.03 KB

Versions: 18

Compression:

Stored size: 1.03 KB

Contents

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

18 entries across 18 versions & 1 rubygems

Version Path
bastion-3.3.4 test/components/bst-alert.directive.test.js
bastion-3.3.3 test/components/bst-alert.directive.test.js
bastion-3.3.2 test/components/bst-alert.directive.test.js
bastion-3.3.1 test/components/bst-alert.directive.test.js
bastion-3.3.0 test/components/bst-alert.directive.test.js
bastion-3.2.2 test/components/bst-alert.directive.test.js
bastion-3.2.1 test/components/bst-alert.directive.test.js
bastion-3.2.0 test/components/bst-alert.directive.test.js
bastion-3.1.0 test/components/bst-alert.directive.test.js
bastion-3.0.1 test/components/bst-alert.directive.test.js
bastion-3.0.0 test/components/bst-alert.directive.test.js
bastion-2.1.0 test/components/bst-alert.directive.test.js
bastion-2.0.4 test/components/bst-alert.directive.test.js
bastion-2.0.3 test/components/bst-alert.directive.test.js
bastion-2.0.2 test/components/bst-alert.directive.test.js
bastion-2.0.1 test/components/bst-alert.directive.test.js
bastion-2.0.0 test/components/bst-alert.directive.test.js
bastion-1.0.2 test/components/bst-alert.directive.test.js