|
|
@@ -33,25 +33,26 @@ describe('denormalize()', () => {
|
|
|
}
|
|
|
|
|
|
expect(Hydra.denormalize(serverResponse)).toStrictEqual<AnyJson>({
|
|
|
- '@context': '/api/contexts/Access',
|
|
|
- '@id': '/api/accesses/7351',
|
|
|
- '@type': 'Access',
|
|
|
- 'hydra:itemPosition': 1,
|
|
|
- 'hydra:next': '/api/organizations?page=2',
|
|
|
- 'hydra:previous': '/api/organizations?page=1',
|
|
|
- 'hydra:totalItems': 20,
|
|
|
- id: 7351,
|
|
|
- itemPosition: 1,
|
|
|
- next: 'organizations?page=2',
|
|
|
- organization: '/api/organizations/37306',
|
|
|
- person: {
|
|
|
- '@type': 'Person',
|
|
|
- givenName: 'Patrick',
|
|
|
- id: 11344,
|
|
|
- name: 'BRUEL'
|
|
|
+ "data": {
|
|
|
+ "@context": "/api/contexts/Access",
|
|
|
+ "@id": "/api/accesses/7351",
|
|
|
+ "@type": "Access",
|
|
|
+ "hydra:itemPosition": 1,
|
|
|
+ "hydra:next": "/api/organizations?page=2",
|
|
|
+ "hydra:previous": "/api/organizations?page=1",
|
|
|
+ "hydra:totalItems": 20,
|
|
|
+ "id": 7351,
|
|
|
+ "organization": "/api/organizations/37306",
|
|
|
+ "person": {
|
|
|
+ "@type": "Person",
|
|
|
+ "givenName": "Patrick",
|
|
|
+ "id": 11344,
|
|
|
+ "name": "BRUEL"
|
|
|
+ }
|
|
|
},
|
|
|
- previous: 'organizations?page=1',
|
|
|
- totalItems: 20
|
|
|
+ "metadata": {
|
|
|
+ "type": 0
|
|
|
+ }
|
|
|
})
|
|
|
})
|
|
|
|
|
|
@@ -99,7 +100,7 @@ describe('denormalize()', () => {
|
|
|
}
|
|
|
|
|
|
const response = Hydra.denormalize(serverResponse)
|
|
|
- expect(JSON.stringify(response)).toEqual(JSON.stringify([
|
|
|
+ expect(JSON.stringify(response)).toEqual(JSON.stringify({"data":[
|
|
|
{
|
|
|
'@id': '/api/accesses/7351',
|
|
|
organization: '/api/organizations/37306',
|
|
|
@@ -124,7 +125,7 @@ describe('denormalize()', () => {
|
|
|
givenName: 'George'
|
|
|
}
|
|
|
}
|
|
|
- ]
|
|
|
+ ], 'metadata':{'type':1}}
|
|
|
))
|
|
|
})
|
|
|
})
|