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
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ describe('formlyMaterial - switch type', () => {
9
9
let $rootScope ;
10
10
let $scope ;
11
11
let element ;
12
+ let elementScope ;
12
13
let field ;
13
14
14
15
//
@@ -21,14 +22,16 @@ describe('formlyMaterial - switch type', () => {
21
22
key : 'testField' ,
22
23
type : 'switch' ,
23
24
templateOptions : {
24
- label : 'test field'
25
+ label : 'test field' ,
26
+ disabled : true
25
27
}
26
28
} , options ) ] ;
27
29
28
30
const form = $compile ( testUtils . getFormTemplate ( ) ) ( $scope ) ;
29
31
30
32
$scope . $digest ( ) ;
31
33
element = form . find ( '[ng-model]' ) ;
34
+ elementScope = element . scope ( ) ;
32
35
field = $scope . fields [ 0 ] ;
33
36
}
34
37
@@ -54,4 +57,9 @@ describe('formlyMaterial - switch type', () => {
54
57
it ( 'should have label' , ( ) => {
55
58
expect ( element . find ( '.md-label > span' ) . html ( ) ) . toContain ( field . templateOptions . label ) ;
56
59
} ) ;
60
+
61
+ it ( 'should be able to be disabled' , ( ) => {
62
+ expect ( element . attr ( 'ng-disabled' ) ) . toBe ( `options.templateOptions['disabled']` ) ;
63
+ expect ( elementScope . options . templateOptions . disabled ) . toBe ( true ) ;
64
+ } ) ;
57
65
} ) ;
You can’t perform that action at this time.
0 commit comments