@@ -25,7 +25,7 @@ describe('findPropertiesByAttribute', () => {
2525 expect ( errors ) . toHaveLength ( 1 ) ;
2626 expect ( errors [ 0 ] ) . toEqual ( {
2727 path : mockPath ,
28- message : `${ errorMessage } Found readOnly property at: `
28+ message : `${ errorMessage } Found readOnly property at one of the inline schemas. `
2929 } ) ;
3030 } ) ;
3131
@@ -50,12 +50,12 @@ describe('findPropertiesByAttribute', () => {
5050 // Testing readOnly detection
5151 let errors = findPropertiesByAttribute ( schema , 'readOnly' , mockPath , [ ] , errorMessage ) ;
5252 expect ( errors ) . toHaveLength ( 1 ) ;
53- expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: id' ) ;
53+ expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: id. ' ) ;
5454
5555 // Testing writeOnly detection
5656 errors = findPropertiesByAttribute ( schema , 'writeOnly' , mockPath , [ ] , errorMessage ) ;
5757 expect ( errors ) . toHaveLength ( 1 ) ;
58- expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: password' ) ;
58+ expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: password. ' ) ;
5959 } ) ;
6060
6161 it ( 'detects nested properties with the specified attribute' , ( ) => {
@@ -86,12 +86,12 @@ describe('findPropertiesByAttribute', () => {
8686 // Testing deep readOnly detection
8787 let errors = findPropertiesByAttribute ( schema , 'readOnly' , mockPath , [ ] , errorMessage ) ;
8888 expect ( errors ) . toHaveLength ( 1 ) ;
89- expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: user.id' ) ;
89+ expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: user.id. ' ) ;
9090
9191 // Testing deep writeOnly detection
9292 errors = findPropertiesByAttribute ( schema , 'writeOnly' , mockPath , [ ] , errorMessage ) ;
9393 expect ( errors ) . toHaveLength ( 1 ) ;
94- expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: user.credentials.password' ) ;
94+ expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: user.credentials.password. ' ) ;
9595 } ) ;
9696
9797 it ( 'detects properties in array items' , ( ) => {
@@ -120,12 +120,12 @@ describe('findPropertiesByAttribute', () => {
120120 // Testing readOnly in array items
121121 let errors = findPropertiesByAttribute ( schema , 'readOnly' , mockPath , [ ] , errorMessage ) ;
122122 expect ( errors ) . toHaveLength ( 1 ) ;
123- expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: items.items.id' ) ;
123+ expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: items.items.id. ' ) ;
124124
125125 // Testing writeOnly in array items
126126 errors = findPropertiesByAttribute ( schema , 'writeOnly' , mockPath , [ ] , errorMessage ) ;
127127 expect ( errors ) . toHaveLength ( 1 ) ;
128- expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: items.items.secret' ) ;
128+ expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: items.items.secret. ' ) ;
129129 } ) ;
130130
131131 it ( 'detects properties in schema combiners' , ( ) => {
@@ -171,13 +171,13 @@ describe('findPropertiesByAttribute', () => {
171171 // Testing readOnly in combiners
172172 let errors = findPropertiesByAttribute ( schema , 'readOnly' , mockPath , [ ] , errorMessage ) ;
173173 expect ( errors ) . toHaveLength ( 2 ) ;
174- expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: allOf.0.id' ) ;
175- expect ( errors [ 1 ] . message ) . toContain ( 'Found readOnly property at: oneOf.1.token' ) ;
174+ expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: allOf.0.id. ' ) ;
175+ expect ( errors [ 1 ] . message ) . toContain ( 'Found readOnly property at: oneOf.1.token. ' ) ;
176176
177177 // Testing writeOnly in combiners
178178 errors = findPropertiesByAttribute ( schema , 'writeOnly' , mockPath , [ ] , errorMessage ) ;
179179 expect ( errors ) . toHaveLength ( 1 ) ;
180- expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: anyOf.0.key' ) ;
180+ expect ( errors [ 0 ] . message ) . toContain ( 'Found writeOnly property at: anyOf.0.key. ' ) ;
181181 } ) ;
182182
183183 it ( 'correctly accumulates multiple errors' , ( ) => {
@@ -209,9 +209,9 @@ describe('findPropertiesByAttribute', () => {
209209 const errors = findPropertiesByAttribute ( schema , 'readOnly' , mockPath , [ ] , errorMessage ) ;
210210
211211 expect ( errors ) . toHaveLength ( 3 ) ;
212- expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: id' ) ;
213- expect ( errors [ 1 ] . message ) . toContain ( 'Found readOnly property at: nested.innerId' ) ;
214- expect ( errors [ 2 ] . message ) . toContain ( 'Found readOnly property at: items.items' ) ;
212+ expect ( errors [ 0 ] . message ) . toContain ( 'Found readOnly property at: id. ' ) ;
213+ expect ( errors [ 1 ] . message ) . toContain ( 'Found readOnly property at: nested.innerId. ' ) ;
214+ expect ( errors [ 2 ] . message ) . toContain ( 'Found readOnly property at: items.items. ' ) ;
215215 } ) ;
216216
217217 it ( 'handles empty objects' , ( ) => {
0 commit comments