File tree Expand file tree Collapse file tree 1 file changed +57
-1
lines changed Expand file tree Collapse file tree 1 file changed +57
-1
lines changed Original file line number Diff line number Diff line change @@ -290,7 +290,7 @@ describe('relationships', () => {
290
290
}
291
291
}
292
292
}
293
- }
293
+ } ;
294
294
295
295
const result = normalize ( json ) ;
296
296
@@ -1201,3 +1201,59 @@ describe('lazy loading', () => {
1201
1201
expect ( isEqual ( result , output ) ) . to . be . true ;
1202
1202
} ) ;
1203
1203
} ) ;
1204
+
1205
+ describe ( 'relationship meta' , ( ) => {
1206
+ const json1 = {
1207
+ "data" : [ {
1208
+ "type" : "post" ,
1209
+ "relationships" : {
1210
+ "question" : {
1211
+ "data" : {
1212
+ "type" : "question" ,
1213
+ "id" : "295"
1214
+ } ,
1215
+ "meta" : {
1216
+ "membership" : {
1217
+ "createdAt" : "2017-11-22" ,
1218
+ "updatedAt" : "2017-11-26"
1219
+ }
1220
+ }
1221
+ }
1222
+ } ,
1223
+ "id" : 2620 ,
1224
+ "attributes" : {
1225
+ "text" : "hello" ,
1226
+ }
1227
+ } ]
1228
+ } ;
1229
+
1230
+ const output1 = {
1231
+ post : {
1232
+ "2620" : {
1233
+ id : 2620 ,
1234
+ attributes : {
1235
+ "text" : "hello" ,
1236
+ } ,
1237
+ relationships : {
1238
+ question : {
1239
+ data : {
1240
+ id : "295" ,
1241
+ type : "question"
1242
+ } ,
1243
+ meta : {
1244
+ membership : {
1245
+ createdAt : "2017-11-22" ,
1246
+ updatedAt : "2017-11-26"
1247
+ }
1248
+ }
1249
+ }
1250
+ }
1251
+ }
1252
+ }
1253
+ } ;
1254
+
1255
+ it ( 'meta in relationship' , ( ) => {
1256
+ const result = normalize ( json1 ) ;
1257
+ expect ( isEqual ( result , output1 ) ) . to . be . true ;
1258
+ } ) ;
1259
+ } ) ;
You can’t perform that action at this time.
0 commit comments