@@ -87,12 +87,12 @@ describe('Data API', () => {
8787 . set ( 'Accept' , 'application/json' ) ;
8888
8989 expect ( response . status ) . toBe ( 200 ) ;
90- expect ( response . body . id ) . toBeDefined ( ) ;
91- expect ( response . body . name ) . toBe ( 'John Doe' ) ;
92- expect ( response . body . email ) . toBe ( 'john@example.com ' ) ;
93- expect ( response . body . id ) . toBeDefined ( ) ;
90+ expect ( response . body . data ) . toBeDefined ( ) ;
91+ expect ( response . body . data . id ) . toBeDefined ( ) ;
92+ expect ( response . body . data . name ) . toBe ( 'John Doe ' ) ;
93+ expect ( response . body . data . email ) . toBe ( 'john@example.com' ) ;
9494
95- createdUserId = response . body . id ;
95+ createdUserId = response . body . data . id ;
9696 } ) ;
9797
9898 it ( 'should find all users' , async ( ) => {
@@ -122,9 +122,10 @@ describe('Data API', () => {
122122 . set ( 'Accept' , 'application/json' ) ;
123123
124124 expect ( response . status ) . toBe ( 200 ) ;
125- expect ( response . body . id ) . toBeDefined ( ) ;
126- expect ( response . body . id ) . toBe ( createdUserId ) ;
127- expect ( response . body . name ) . toBe ( 'John Doe' ) ;
125+ expect ( response . body . data ) . toBeDefined ( ) ;
126+ expect ( response . body . data . id ) . toBeDefined ( ) ;
127+ expect ( response . body . data . id ) . toBe ( createdUserId ) ;
128+ expect ( response . body . data . name ) . toBe ( 'John Doe' ) ;
128129 } ) ;
129130
130131 it ( 'should update a user' , async ( ) => {
@@ -143,7 +144,8 @@ describe('Data API', () => {
143144 . set ( 'Accept' , 'application/json' ) ;
144145
145146 expect ( response . status ) . toBe ( 200 ) ;
146- expect ( response . body . id ) . toBeDefined ( ) ;
147+ expect ( response . body . data ) . toBeDefined ( ) ;
148+ expect ( response . body . data . id ) . toBeDefined ( ) ;
147149 } ) ;
148150
149151
@@ -169,11 +171,11 @@ describe('Data API', () => {
169171 . set ( 'Accept' , 'application/json' ) ;
170172
171173 expect ( response . status ) . toBe ( 200 ) ;
172- expect ( response . body . id ) . toBeDefined ( ) ;
173- expect ( response . body . title ) . toBe ( 'Test Task' ) ;
174- expect ( response . body . id ) . toBeDefined ( ) ;
174+ expect ( response . body . data ) . toBeDefined ( ) ;
175+ expect ( response . body . data . id ) . toBeDefined ( ) ;
176+ expect ( response . body . data . title ) . toBe ( 'Test Task' ) ;
175177
176- createdTaskId = response . body . id ;
178+ createdTaskId = response . body . data . id ;
177179 } ) ;
178180
179181 it ( 'should find tasks with filter' , async ( ) => {
@@ -210,7 +212,8 @@ describe('Data API', () => {
210212 . set ( 'Accept' , 'application/json' ) ;
211213
212214 expect ( response . status ) . toBe ( 200 ) ;
213- expect ( response . body . id ) . toBeDefined ( ) ;
215+ expect ( response . body . data ) . toBeDefined ( ) ;
216+ expect ( response . body . data . id ) . toBeDefined ( ) ;
214217 } ) ;
215218
216219
@@ -233,11 +236,11 @@ describe('Data API', () => {
233236 . set ( 'Accept' , 'application/json' ) ;
234237
235238 expect ( response . status ) . toBe ( 201 ) ;
236- expect ( response . body . id ) . toBeDefined ( ) ;
237- expect ( response . body . id ) . toBeDefined ( ) ;
238- expect ( response . body . name ) . toBe ( 'Jane Smith' ) ;
239+ expect ( response . body . data ) . toBeDefined ( ) ;
240+ expect ( response . body . data . id ) . toBeDefined ( ) ;
241+ expect ( response . body . data . name ) . toBe ( 'Jane Smith' ) ;
239242
240- userId = response . body . id ;
243+ userId = response . body . data . id ;
241244 } ) ;
242245
243246 it ( 'should list users via GET /api/data/user' , async ( ) => {
@@ -267,7 +270,8 @@ describe('Data API', () => {
267270 . set ( 'Accept' , 'application/json' ) ;
268271
269272 expect ( response . status ) . toBe ( 200 ) ;
270- expect ( response . body . id ) . toBeDefined ( ) ;
273+ expect ( response . body . data ) . toBeDefined ( ) ;
274+ expect ( response . body . data . id ) . toBeDefined ( ) ;
271275 } ) ;
272276
273277 it ( 'should delete user via DELETE /api/data/user/:id' , async ( ) => {
@@ -290,10 +294,11 @@ describe('Data API', () => {
290294 . set ( 'Accept' , 'application/json' ) ;
291295
292296 expect ( response . status ) . toBe ( 201 ) ;
293- expect ( response . body . id ) . toBeDefined ( ) ;
294- expect ( response . body . title ) . toBe ( 'REST API Task' ) ;
297+ expect ( response . body . data ) . toBeDefined ( ) ;
298+ expect ( response . body . data . id ) . toBeDefined ( ) ;
299+ expect ( response . body . data . title ) . toBe ( 'REST API Task' ) ;
295300
296- taskId = response . body . id ;
301+ taskId = response . body . data . id ;
297302 } ) ;
298303
299304 it ( 'should list tasks via GET /api/data/task' , async ( ) => {
@@ -315,7 +320,8 @@ describe('Data API', () => {
315320 . set ( 'Accept' , 'application/json' ) ;
316321
317322 expect ( response . status ) . toBe ( 200 ) ;
318- expect ( response . body . id ) . toBeDefined ( ) ;
323+ expect ( response . body . data ) . toBeDefined ( ) ;
324+ expect ( response . body . data . id ) . toBeDefined ( ) ;
319325 } ) ;
320326
321327 it ( 'should delete task via DELETE /api/data/task/:id' , async ( ) => {
0 commit comments