mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
chore: Add root container tests for FileDataAccessor
This commit is contained in:
parent
fc8540f553
commit
90bdfb5583
@ -287,6 +287,12 @@ describe('A FileDataAccessor', (): void => {
|
||||
await expect(accessor.writeContainer({ path: `${base}container/` }, metadata)).resolves.toBeUndefined();
|
||||
expect(cache.data.container).toEqual({});
|
||||
});
|
||||
|
||||
it('can write to the root container.', async(): Promise<void> => {
|
||||
metadata = new RepresentationMetadata({ path: `${base}` }, { likes: 'apples' });
|
||||
await expect(accessor.writeContainer({ path: `${base}` }, metadata)).resolves.toBeUndefined();
|
||||
expect(cache.data).toEqual({ '.meta': expect.stringMatching(`<${base}> <likes> "apples".`) });
|
||||
});
|
||||
});
|
||||
|
||||
describe('deleting a resource', (): void => {
|
||||
@ -334,5 +340,11 @@ describe('A FileDataAccessor', (): void => {
|
||||
await expect(accessor.deleteResource({ path: `${base}container/` })).resolves.toBeUndefined();
|
||||
expect(cache.data.container).toBeUndefined();
|
||||
});
|
||||
|
||||
it('can delete the root container.', async(): Promise<void> => {
|
||||
cache.data = { };
|
||||
await expect(accessor.deleteResource({ path: `${base}` })).resolves.toBeUndefined();
|
||||
expect(cache.data).toBeUndefined();
|
||||
});
|
||||
});
|
||||
});
|
||||
|
Loading…
x
Reference in New Issue
Block a user