fix: Create container data before adding content-type

This commit is contained in:
Joachim Van Herwegen
2020-12-02 14:03:16 +01:00
parent 82393ed33b
commit c2b189184b
2 changed files with 5 additions and 7 deletions

View File

@@ -108,9 +108,10 @@ describe('A DataAccessorBasedStore', (): void => {
it('will return a data stream that matches the metadata for containers.', async(): Promise<void> => {
const resourceID = { path: `${root}container/` };
accessor.data[resourceID.path] = { metadata: containerMetadata } as Representation;
const metaQuads = containerMetadata.quads();
const result = await store.getRepresentation(resourceID);
expect(result).toMatchObject({ binary: false });
expect(await arrayifyStream(result.data)).toBeRdfIsomorphic(containerMetadata.quads());
expect(await arrayifyStream(result.data)).toBeRdfIsomorphic(metaQuads);
expect(result.metadata.contentType).toEqual(INTERNAL_QUADS);
});
});