tellform/public/modules/forms/tests/unit/services/time-counter.client.service.test.js

28 lines
727 B
JavaScript
Raw Normal View History

2015-08-21 00:17:14 +00:00
'use strict';
(function() {
// Forms Controller Spec
describe('TimeCounter Service Tests', function() {
// Initialize global variables
var TimeCounter;
// Load the main application module
beforeEach(module(ApplicationConfiguration.applicationModuleName));
beforeEach(inject(function (_TimeCounter_) {
TimeCounter = _TimeCounter_;
}));
it('should be able to time 1 second interval as 1 second', function() {
var timeSpent = 0;
2015-11-23 19:19:02 +00:00
TimeCounter.restartClock();
2015-08-21 00:17:14 +00:00
setTimeout(function(){
timeSpent = TimeCounter.stopClock();
expect(timeSpent).toEqual(1);
},1000);
});
});
}());