forked from siddii/angular-timer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdirectivesSpec.js
More file actions
25 lines (21 loc) · 801 Bytes
/
directivesSpec.js
File metadata and controls
25 lines (21 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
'use strict';
/* jasmine specs for directives go here */
describe('timer directive', function() {
beforeEach(module('timer'));
describe('default timer', function() {
it('should run timer with 1 millisecond interval', function() {
inject(function($compile, $rootScope, $browser, $timeout, $exceptionHandler) {
var $scope = $rootScope.$new();
var element = $compile('<timer/>')($scope);
$scope.$digest();
$timeout(function() {
expect(element.html()).toMatch(/^<span class="ng-binding ng-scope">/);
expect(element.html().indexOf('</span>')).toBeGreaterThan(-1);
$rootScope.$broadcast('timer-stop');
}, 300);
$timeout.flush();
expect($exceptionHandler.errors).toEqual([]);
});
});
});
});