@@ -236,7 +236,7 @@ function atRest(store: Store) {
236236async function created ( store : Store ) {
237237 const first = await boot ( store ) ;
238238 const res = await first . send ( 'POST' , '/datasources' , { ...CREATE , secret : REAL_PASSWORD } ) ;
239- expect ( { status : res . status , dsStatus : res . body . data ?. status } ) . toEqual ( { status : 201 , dsStatus : 'ok' } ) ;
239+ expect ( { status : res . status , dsStatus : res . body . data ?. datasource ?. status } ) . toEqual ( { status : 201 , dsStatus : 'ok' } ) ;
240240 return first ;
241241}
242242
@@ -253,8 +253,8 @@ describe('PATCH /api/v1/datasources/:name — a new secret that fails to connect
253253 label : 'Renamed in the same patch' ,
254254 } ) ;
255255 expect ( res . status ) . toBe ( 200 ) ;
256- expect ( res . body . data . status ) . toBe ( 'error' ) ;
257- expect ( res . body . data . statusReason ) . toContain ( 'the new configuration is NOT in force' ) ;
256+ expect ( res . body . data . datasource . status ) . toBe ( 'error' ) ;
257+ expect ( res . body . data . datasource . statusReason ) . toContain ( 'the new configuration is NOT in force' ) ;
258258
259259 // Nothing of the patch is at rest: not the new binding, not the other key,
260260 // and the secret sealed for it is gone again.
@@ -275,7 +275,7 @@ describe('PATCH /api/v1/datasources/:name — a new secret that fails to connect
275275 const res = await first . send ( 'PATCH' , `/datasources/${ CREATE . name } ` , {
276276 config : { ...CREATE . config , database : 'qa_other' } ,
277277 } ) ;
278- expect ( res . body . data . statusReason ) . toContain ( 'the new configuration is NOT in force' ) ;
278+ expect ( res . body . data . datasource . statusReason ) . toContain ( 'the new configuration is NOT in force' ) ;
279279 expect ( atRest ( store ) ) . toEqual ( before ) ;
280280 expect ( ( await boot ( store ) ) . factory . built ) . toEqual ( [ REAL_PASSWORD ] ) ;
281281 } ) ;
@@ -287,7 +287,7 @@ describe('PATCH /api/v1/datasources/:name — a new secret that fails to connect
287287
288288 const res = await first . send ( 'PATCH' , `/datasources/${ CREATE . name } ` , { secret : REAL_PASSWORD } ) ;
289289 expect ( res . status ) . toBe ( 200 ) ;
290- expect ( res . body . data . status ) . toBe ( 'ok' ) ;
290+ expect ( res . body . data . datasource . status ) . toBe ( 'ok' ) ;
291291
292292 const after = atRest ( store ) ;
293293 expect ( after . record . external . credentialsRef ) . not . toBe ( before . record . external . credentialsRef ) ;
@@ -306,7 +306,7 @@ describe('PATCH /api/v1/datasources/:name — a new secret that fails to connect
306306 const before = atRest ( store ) ;
307307 for ( const secret of [ WRONG_PASSWORD , NEW_PASSWORD ] ) {
308308 const res = await first . send ( 'PATCH' , `/datasources/${ CREATE . name } ` , { secret } ) ;
309- expect ( res . body . data . statusReason ) . toContain ( 'the new configuration is NOT in force' ) ;
309+ expect ( res . body . data . datasource . statusReason ) . toContain ( 'the new configuration is NOT in force' ) ;
310310 }
311311 expect ( atRest ( store ) ) . toEqual ( before ) ;
312312 expect ( ( await boot ( store ) ) . factory . built ) . toEqual ( [ REAL_PASSWORD ] ) ;
0 commit comments