@@ -37,7 +37,7 @@ describe('uiValidate', function () {
37
37
scope . validate = trueValidator ;
38
38
compileAndDigest ( '<input name="input" ng-model="value" ui-validate="\'validate($value)\'">' , scope ) ;
39
39
expect ( scope . form . input . $valid ) . toBeTruthy ( ) ;
40
- expect ( scope . form . input . $error ) . toEqual ( { validator : false } ) ;
40
+ expect ( scope . form . input . $error ) . toEqual ( { } ) ;
41
41
} ) ) ;
42
42
43
43
it ( 'should mark input as invalid if initial model is invalid' , inject ( function ( ) {
@@ -113,7 +113,7 @@ describe('uiValidate', function () {
113
113
expect ( scope . form . input . $error . validator ) . toBe ( true ) ;
114
114
scope . $apply ( 'watchMe=true' ) ;
115
115
expect ( scope . form . input . $valid ) . toBe ( true ) ;
116
- expect ( scope . form . input . $error . validator ) . toBe ( false ) ;
116
+ expect ( scope . form . input . $error . validator ) . toBeUndefined ( ) ;
117
117
} ) ;
118
118
119
119
it ( 'should watch the string and refire all validators' , function ( ) {
@@ -124,8 +124,8 @@ describe('uiValidate', function () {
124
124
expect ( scope . form . input . $error . bar ) . toBe ( true ) ;
125
125
scope . $apply ( 'watchMe=true' ) ;
126
126
expect ( scope . form . input . $valid ) . toBe ( true ) ;
127
- expect ( scope . form . input . $error . foo ) . toBe ( false ) ;
128
- expect ( scope . form . input . $error . bar ) . toBe ( false ) ;
127
+ expect ( scope . form . input . $error . foo ) . toBeUndefined ( ) ;
128
+ expect ( scope . form . input . $error . bar ) . toBeUndefined ( ) ;
129
129
} ) ;
130
130
131
131
it ( 'should watch the all object attributes and each respective validator' , function ( ) {
@@ -137,17 +137,17 @@ describe('uiValidate', function () {
137
137
expect ( scope . form . input . $error . bar ) . toBe ( true ) ;
138
138
scope . $apply ( 'watchFoo=true' ) ;
139
139
expect ( scope . form . input . $valid ) . toBe ( false ) ;
140
- expect ( scope . form . input . $error . foo ) . toBe ( false ) ;
140
+ expect ( scope . form . input . $error . foo ) . toBeUndefined ( ) ;
141
141
expect ( scope . form . input . $error . bar ) . toBe ( true ) ;
142
142
scope . $apply ( 'watchBar=true' ) ;
143
143
scope . $apply ( 'watchFoo=false' ) ;
144
144
expect ( scope . form . input . $valid ) . toBe ( false ) ;
145
145
expect ( scope . form . input . $error . foo ) . toBe ( true ) ;
146
- expect ( scope . form . input . $error . bar ) . toBe ( false ) ;
146
+ expect ( scope . form . input . $error . bar ) . toBeUndefined ( ) ;
147
147
scope . $apply ( 'watchFoo=true' ) ;
148
148
expect ( scope . form . input . $valid ) . toBe ( true ) ;
149
- expect ( scope . form . input . $error . foo ) . toBe ( false ) ;
150
- expect ( scope . form . input . $error . bar ) . toBe ( false ) ;
149
+ expect ( scope . form . input . $error . foo ) . toBeUndefined ( ) ;
150
+ expect ( scope . form . input . $error . bar ) . toBeUndefined ( ) ;
151
151
} ) ;
152
152
153
153
} ) ;
@@ -156,7 +156,7 @@ describe('uiValidate', function () {
156
156
it ( 'should fail if ngModel not present' , inject ( function ( ) {
157
157
expect ( function ( ) {
158
158
compileAndDigest ( '<input name="input" ui-validate="\'validate($value)\'">' , scope ) ;
159
- } ) . toThrow ( new Error ( 'No controller: ngModel' ) ) ;
159
+ } ) . toThrow ( ) ;
160
160
} ) ) ;
161
161
it ( 'should have no effect if validate expression is empty' , inject ( function ( ) {
162
162
compileAndDigest ( '<input ng-model="value" ui-validate="">' , scope ) ;
0 commit comments