This repository was archived by the owner on Jan 22, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -10,11 +10,13 @@ describe('formlyMaterial - slider type', () => {
10
10
let $scope ;
11
11
let form ;
12
12
let element ;
13
+ let elementScope ;
13
14
const fieldConfig = {
14
15
key : 'testField' ,
15
16
type : 'slider' ,
16
17
templateOptions : {
17
18
label : 'test field' ,
19
+ disabled : true ,
18
20
min : 1 ,
19
21
max : 5 ,
20
22
step : 0.5 ,
@@ -32,6 +34,7 @@ describe('formlyMaterial - slider type', () => {
32
34
form = $compile ( testUtils . getFormTemplate ( ) ) ( $scope ) ;
33
35
$scope . $digest ( ) ;
34
36
element = form . find ( '[ng-model]' ) ;
37
+ elementScope = element . scope ( ) ;
35
38
}
36
39
37
40
//
@@ -66,9 +69,12 @@ describe('formlyMaterial - slider type', () => {
66
69
} ) ;
67
70
68
71
it ( 'should support discrete option' , ( ) => {
69
- const scope = angular . element ( element ) . scope ( ) ;
70
-
71
72
expect ( element . attr ( 'md-discrete' ) ) . toEqual ( `options.templateOptions['discrete']` ) ;
72
- expect ( scope . options . templateOptions . discrete ) . toBe ( fieldConfig . templateOptions . discrete ) ;
73
+ expect ( elementScope . options . templateOptions . discrete ) . toBe ( fieldConfig . templateOptions . discrete ) ;
74
+ } ) ;
75
+
76
+ it ( 'should be able to be disabled' , ( ) => {
77
+ expect ( element . attr ( 'ng-disabled' ) ) . toBe ( `options.templateOptions['disabled']` ) ;
78
+ expect ( elementScope . options . templateOptions . disabled ) . toBe ( true ) ;
73
79
} ) ;
74
80
} ) ;
You can’t perform that action at this time.
0 commit comments