@@ -65,7 +65,7 @@ describe('Field validation', () => {
6565 handle : 'hello world' ,
6666 } ,
6767 } )
68- ) . toBeRejectedByPolicy ( [ 'String must contain at least 8 character(s) at "password" ' , 'Invalid at " handle" ' ] ) ;
68+ ) . toBeRejectedByPolicy ( [ '8 character' , 'handle' ] ) ;
6969
7070 let err : any ;
7171 try {
@@ -98,11 +98,7 @@ describe('Field validation', () => {
9898 handle : 'user1user1user1user1user1' ,
9999 } ,
100100 } )
101- ) . toBeRejectedByPolicy ( [
102- 'Invalid email at "email"' ,
103- 'must end with "@myorg.com" at "email"' ,
104- 'Invalid at "handle"' ,
105- ] ) ;
101+ ) . toBeRejectedByPolicy ( [ 'email' , 'handle' ] ) ;
106102
107103 await expect (
108104 db . user . create ( {
@@ -123,10 +119,7 @@ describe('Field validation', () => {
123119 email : 'something' ,
124120 } ,
125121 } )
126- ) . toBeRejectedByPolicy ( [
127- 'String must contain at least 8 character(s) at "password"' ,
128- 'must end with "@myorg.com" at "email"' ,
129- ] ) ;
122+ ) . toBeRejectedByPolicy ( [ '8 character' , 'email' ] ) ;
130123
131124 await expect (
132125 db . user . update ( {
@@ -135,7 +128,7 @@ describe('Field validation', () => {
135128 age : { increment : 100 } ,
136129 } ,
137130 } )
138- ) . toBeRejectedByPolicy ( [ 'Number must be less than 100 at "age" ' ] ) ;
131+ ) . toBeRejectedByPolicy ( [ '100' ] ) ;
139132
140133 await expect (
141134 db . user . update ( {
@@ -173,15 +166,15 @@ describe('Field validation', () => {
173166 } ,
174167 } )
175168 ) . toBeRejectedByPolicy ( [
176- 'Number must be greater than 0 at "a"' ,
177- 'Number must be greater than or equal to 0 at "b"' ,
178- 'Number must be less than 0 at "c"' ,
179- 'Number must be less than or equal to 0 at "d"' ,
180- 'must start with "abc" at " text1" ' ,
181- 'must end with "def" at " text2" ' ,
182- 'String must contain at least 3 character(s) at " text3" ' ,
183- 'String must contain at most 5 character(s) at " text4" ' ,
184- 'must end with "xyz" at " text5" ' ,
169+ '0 at "a"' ,
170+ '0 at "b"' ,
171+ '0 at "c"' ,
172+ '0 at "d"' ,
173+ 'text1' ,
174+ 'text2' ,
175+ 'text3' ,
176+ 'text4' ,
177+ 'text5' ,
185178 ] ) ;
186179
187180 await expect (
@@ -240,7 +233,7 @@ describe('Field validation', () => {
240233 } ,
241234 } ,
242235 } )
243- ) . toBeRejectedByPolicy ( [ 'Number must be greater than 0 at "a"' ] ) ;
236+ ) . toBeRejectedByPolicy ( [ '0 at "a"' ] ) ;
244237
245238 await expect (
246239 db . user . create ( {
@@ -253,7 +246,7 @@ describe('Field validation', () => {
253246 } ,
254247 } ,
255248 } )
256- ) . toBeRejectedByPolicy ( [ 'Invalid at " slug" ' ] ) ;
249+ ) . toBeRejectedByPolicy ( [ 'slug' ] ) ;
257250
258251 await expect (
259252 db . user . create ( {
@@ -272,7 +265,7 @@ describe('Field validation', () => {
272265 } ,
273266 } ,
274267 } )
275- ) . toBeRejectedByPolicy ( [ 'Number must be greater than 0 at "a"' ] ) ;
268+ ) . toBeRejectedByPolicy ( [ '0 at "a"' ] ) ;
276269
277270 await expect (
278271 db . user . create ( {
@@ -290,7 +283,7 @@ describe('Field validation', () => {
290283 } ,
291284 } ,
292285 } )
293- ) . toBeRejectedByPolicy ( [ 'Invalid at " slug" ' ] ) ;
286+ ) . toBeRejectedByPolicy ( [ 'slug' ] ) ;
294287
295288 await expect (
296289 db . user . create ( {
@@ -351,7 +344,7 @@ describe('Field validation', () => {
351344 } ,
352345 } ,
353346 } )
354- ) . toBeRejectedByPolicy ( [ 'Number must be greater than 0 at "a"' ] ) ;
347+ ) . toBeRejectedByPolicy ( [ '0 at "a"' ] ) ;
355348
356349 await expect (
357350 db . user . update ( {
@@ -364,7 +357,7 @@ describe('Field validation', () => {
364357 } ,
365358 } ,
366359 } )
367- ) . toBeRejectedByPolicy ( [ 'Invalid at " slug" ' ] ) ;
360+ ) . toBeRejectedByPolicy ( [ 'slug' ] ) ;
368361
369362 await expect (
370363 db . user . update ( {
@@ -394,7 +387,7 @@ describe('Field validation', () => {
394387 } ,
395388 } ,
396389 } )
397- ) . toBeRejectedByPolicy ( [ 'Number must be greater than 0 at "a"' ] ) ;
390+ ) . toBeRejectedByPolicy ( [ '0 at "a"' ] ) ;
398391
399392 await expect (
400393 db . user . update ( {
@@ -410,7 +403,7 @@ describe('Field validation', () => {
410403 } ,
411404 } ,
412405 } )
413- ) . toBeRejectedByPolicy ( [ 'Invalid at " slug" ' ] ) ;
406+ ) . toBeRejectedByPolicy ( [ 'slug' ] ) ;
414407
415408 await expect (
416409 db . user . update ( {
@@ -450,7 +443,7 @@ describe('Field validation', () => {
450443 } ,
451444 } ,
452445 } )
453- ) . toBeRejectedByPolicy ( [ 'Number must be greater than 0 at "a"' ] ) ;
446+ ) . toBeRejectedByPolicy ( [ '0 at "a"' ] ) ;
454447
455448 await expect (
456449 db . user . update ( {
@@ -466,7 +459,7 @@ describe('Field validation', () => {
466459 } ,
467460 } ,
468461 } )
469- ) . toBeRejectedByPolicy ( [ 'Invalid at " slug" ' ] ) ;
462+ ) . toBeRejectedByPolicy ( [ 'slug' ] ) ;
470463
471464 await expect (
472465 db . user . update ( {
@@ -979,7 +972,7 @@ describe('Policy and validation interaction', () => {
979972 age : 18 ,
980973 } ,
981974 } )
982- ) . toBeRejectedByPolicy ( [ 'Invalid email at "email" ' ] ) ;
975+ ) . toBeRejectedByPolicy ( [ 'email' ] ) ;
983976
984977 await expect (
985978 db . user . create ( {
0 commit comments