feat: Store target identifier when parsing metadata

This commit is contained in:
Joachim Van Herwegen
2021-01-07 15:55:19 +01:00
parent f17054c647
commit 76def28a68
4 changed files with 11 additions and 5 deletions

View File

@@ -32,7 +32,11 @@ describe('A BasicMetadataExtractor', (): void => {
});
it('will add metadata from the parsers.', async(): Promise<void> => {
const metadata = await handler.handle({ request: { headers: { aa: 'valA', bb: 'valB' } as any } as HttpRequest });
const target = { path: 'http://test.com/id' };
const metadata = await handler.handle(
{ target, request: { headers: { aa: 'valA', bb: 'valB' } as any } as HttpRequest },
);
expect(metadata.identifier.value).toBe(target.path);
expect(metadata.getAll(RDF.type).map((term): any => term.value)).toEqual([ 'valA', 'valB' ]);
});
});