mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Only accept NamedNodes as predicates for metadata
* refactor: move toCachedNamedNode (private) * chore: only NamedNodes predicates in removes * feat: enforce NamedNode predicates in most cases * feat: getAll only accepts NamedNodes * feat: toCachedNamedNode only accepts string arg * tests: use NamedNodes for getAll calls * test: remove unnecessary string check for coverage * tests: fix NamedNodes in new tests after rebase * feat: metadatawriters store NamedNodes * refactor: toCachedNamedNode as utility function * fix: double write of linkRelMap * test: use the CONTENT_TYPE constant
This commit is contained in:
@@ -63,7 +63,7 @@ describe('A ConstantConverter', (): void => {
|
||||
|
||||
it('does not support representations that are already in the right format.', async(): Promise<void> => {
|
||||
const preferences = { type: { 'text/html': 1 }};
|
||||
const metadata = new RepresentationMetadata({ contentType: 'text/html' });
|
||||
const metadata = new RepresentationMetadata({ [CONTENT_TYPE]: 'text/html' });
|
||||
const representation = { metadata } as any;
|
||||
const args = { identifier, representation, preferences };
|
||||
|
||||
@@ -101,7 +101,7 @@ describe('A ConstantConverter', (): void => {
|
||||
|
||||
it('replaces the representation of a supported request.', async(): Promise<void> => {
|
||||
const preferences = { type: { 'text/html': 1 }};
|
||||
const metadata = new RepresentationMetadata({ contentType: 'text/turtle' });
|
||||
const metadata = new RepresentationMetadata({ [CONTENT_TYPE]: 'text/turtle' });
|
||||
const representation = { metadata, data: { destroy: jest.fn() }} as any;
|
||||
const args = { identifier, representation, preferences };
|
||||
|
||||
|
||||
Reference in New Issue
Block a user