-
Notifications
You must be signed in to change notification settings - Fork 297
/
explicitSave.spec.js
40 lines (30 loc) · 1.15 KB
/
explicitSave.spec.js
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
'use strict';
describe('Controller: ExplicitSaveDemoCtrl', function() {
var $scope, injections;
beforeEach(module('app'));
beforeEach(inject(function($rootScope, $controller, $window, $interval){
$scope = $rootScope.$new();
injections = {
$scope: $scope,
$window: $window,
$interval: $interval
};
$controller('ExplicitSaveDemoCtrl', injections);
}));
describe('the controller properties', function() {
it('should have properties in scope', function() {
expect($scope.randomValue).toBeDefined();
expect($scope.dashboardOptions.widgetButtons).toBe(true);
expect($scope.dashboardOptions.widgetDefinitions).toBeDefined();
expect($scope.dashboardOptions.defaultWidgets).toBeDefined();
expect($scope.dashboardOptions.storage).toBeDefined();
expect($scope.dashboardOptions.storageId).toEqual('explicitSave');
expect($scope.dashboardOptions.explicitSave).toBe(true);
});
it('should change randomValue', function() {
var savedValue = $scope.randomValue;
injections.$interval.flush(500);
expect($scope.randomValue).not.toEqual(savedValue);
});
});
});