-
-
Notifications
You must be signed in to change notification settings - Fork 497
/
Copy pathrz-slider-options-test.js
48 lines (40 loc) · 1.27 KB
/
rz-slider-options-test.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
41
42
43
44
45
46
47
48
;(function() {
'use strict'
describe('RzSliderOptions - ', function() {
var helper, RzSliderOptions, $rootScope, $timeout
beforeEach(module('test-helper'))
beforeEach(inject(function(
TestHelper,
_RzSliderOptions_,
_$rootScope_,
_$timeout_
) {
helper = TestHelper
RzSliderOptions = _RzSliderOptions_
$rootScope = _$rootScope_
$timeout = _$timeout_
}))
afterEach(function() {
helper.clean()
})
it('should have a correct getOptions method that apply custom options', function() {
var defaultOpts = RzSliderOptions.getOptions()
var customOpts = {
showTicks: true,
}
var expectedOpts = angular.extend({}, defaultOpts, customOpts)
var options = RzSliderOptions.getOptions(customOpts)
expect(options).to.deep.equal(expectedOpts)
})
it('should have a correct options method to update the global options', function() {
var defaultOpts = RzSliderOptions.getOptions()
var globalOpts = {
showTicks: true,
}
RzSliderOptions.options(globalOpts)
var expectedOpts = angular.extend({}, defaultOpts, globalOpts)
var options = RzSliderOptions.getOptions()
expect(options).to.deep.equal(expectedOpts)
})
})
})()