@@ -1320,33 +1320,35 @@ describe('formly-field', function() {
1320
1320
} ) ;
1321
1321
} ) ;
1322
1322
1323
- describe ( `with custom errorExistsAndShouldBeVisible expression` , ( ) => {
1324
- beforeEach ( ( ) => {
1325
- scope . fields = [ getNewField ( { validators : { foo : 'false' } } ) ] ;
1326
- } ) ;
1323
+ describe ( `options.validation.errorExistsAndShouldBeVisible` , ( ) => {
1324
+ describe ( `with custom errorExistsAndShouldBeVisible expression` , ( ) => {
1325
+ beforeEach ( ( ) => {
1326
+ scope . fields = [ getNewField ( { validators : { foo : 'false' } } ) ] ;
1327
+ } ) ;
1327
1328
1328
- it ( `should set errorExistsAndShouldBeVisible to true when the expression function says so` , ( ) => {
1329
- formlyConfig . extras . errorExistsAndShouldBeVisibleExpression = '!!options.data.customExpression' ;
1330
- compileAndDigest ( ) ;
1331
- expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . false ;
1332
- field . data . customExpression = true ;
1333
- scope . $digest ( ) ;
1334
- expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . true ;
1335
- } ) ;
1336
-
1337
- it ( `should be able to work with form.$submitted` , ( ) => {
1338
- formlyConfig . extras . errorExistsAndShouldBeVisibleExpression = 'form.$submitted' ;
1339
- compileAndDigest ( `
1340
- <form name="theForm">
1341
- <formly-form form="theForm" model="model" fields="fields" options="options"></formly-form>
1342
- </form>
1343
- ` ) ;
1344
- expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . false ;
1345
- scope . theForm . $setSubmitted ( true ) ;
1346
- scope . $digest ( ) ;
1347
- expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . true ;
1348
- } ) ;
1329
+ it ( `should set errorExistsAndShouldBeVisible to true when the expression function says so` , ( ) => {
1330
+ formlyConfig . extras . errorExistsAndShouldBeVisibleExpression = '!!options.data.customExpression' ;
1331
+ compileAndDigest ( ) ;
1332
+ expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . false ;
1333
+ field . data . customExpression = true ;
1334
+ scope . $digest ( ) ;
1335
+ expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . true ;
1336
+ } ) ;
1349
1337
1338
+ it ( `should be able to work with form.$submitted` , ( ) => {
1339
+ formlyConfig . extras . errorExistsAndShouldBeVisibleExpression = 'form.$submitted' ;
1340
+ compileAndDigest ( `
1341
+ <form name="theForm">
1342
+ <formly-form form="theForm" model="model" fields="fields" options="options"></formly-form>
1343
+ </form>
1344
+ ` ) ;
1345
+ expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . false ;
1346
+ scope . theForm . $setSubmitted ( true ) ;
1347
+ scope . $digest ( ) ;
1348
+ expect ( field . validation . errorExistsAndShouldBeVisible ) . to . be . true ;
1349
+ } ) ;
1350
+
1351
+ } ) ;
1350
1352
} ) ;
1351
1353
1352
1354
describe ( `with specified "model" property` , ( ) => {
0 commit comments