mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
change: Make RepresentationMetadata accept a ResourceIdentifier.
Closes https://github.com/solid/community-server/issues/388
This commit is contained in:
committed by
Joachim Van Herwegen
parent
6ee56a6d67
commit
accfc2e58d
@@ -28,12 +28,12 @@ describe('A RepresentationMetadata', (): void => {
|
||||
});
|
||||
|
||||
it('converts identifier strings to named nodes.', async(): Promise<void> => {
|
||||
metadata = new RepresentationMetadata('identifier');
|
||||
metadata = new RepresentationMetadata({ path: 'identifier' });
|
||||
expect(metadata.identifier).toEqualRdfTerm(namedNode('identifier'));
|
||||
});
|
||||
|
||||
it('copies an other metadata object.', async(): Promise<void> => {
|
||||
const other = new RepresentationMetadata('otherId', { 'test:pred': 'objVal' });
|
||||
const other = new RepresentationMetadata({ path: 'otherId' }, { 'test:pred': 'objVal' });
|
||||
metadata = new RepresentationMetadata(other);
|
||||
expect(metadata.identifier).toEqualRdfTerm(namedNode('otherId'));
|
||||
expect(metadata.quads()).toBeRdfIsomorphic([
|
||||
@@ -59,7 +59,7 @@ describe('A RepresentationMetadata', (): void => {
|
||||
});
|
||||
|
||||
it('can combine overrides with other metadata.', async(): Promise<void> => {
|
||||
const other = new RepresentationMetadata('otherId', { 'test:pred': 'objVal' });
|
||||
const other = new RepresentationMetadata({ path: 'otherId' }, { 'test:pred': 'objVal' });
|
||||
metadata = new RepresentationMetadata(other, { 'test:pred': 'objVal2' });
|
||||
expect(metadata.quads()).toBeRdfIsomorphic([
|
||||
quad(namedNode('otherId'), namedNode('test:pred'), literal('objVal2')) ]);
|
||||
@@ -101,7 +101,7 @@ describe('A RepresentationMetadata', (): void => {
|
||||
});
|
||||
|
||||
it('updates its identifier when copying metadata.', async(): Promise<void> => {
|
||||
const other = new RepresentationMetadata('otherId', { 'test:pred': 'objVal' });
|
||||
const other = new RepresentationMetadata({ path: 'otherId' }, { 'test:pred': 'objVal' });
|
||||
metadata.setMetadata(other);
|
||||
|
||||
// `setMetadata` should have the same result as the following
|
||||
|
||||
Reference in New Issue
Block a user