bansho/app/components/topbar/topbar_test.js
2015-02-03 13:51:33 -05:00

44 lines
1.1 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
describe('Topbar module', function () {
var $compile,
$rootScope,
$controller,
$httpBackend;
beforeEach(module('adagios.topbar'));
beforeEach(inject(function (_$compile_, _$rootScope_, _$controller_, _$httpBackend_) {
$compile = _$compile_;
$rootScope = _$rootScope_;
$controller = _$controller_;
$httpBackend = _$httpBackend_;
$httpBackend.expectGET('components/topbar/topbar.html').respond('<a>{{ notifications }}</a>');
}));
describe('TopBarCtrl', function () {
it('should be defined', function () {
var scope = $rootScope.$new(),
topbar = $controller('TopBarCtrl', { $scope : scope });
expect(topbar).toBeDefined();
});
});
describe('Topbar directive', function () {
it('should insert the number of warnings', function () {
var element = $compile('<adg-topbar></adg-topbar>')($rootScope);
$httpBackend.flush();
$rootScope.notifications = 44;
$rootScope.$digest();
expect(element.text()).toBe('44');
});
});
});