mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
feat: Added resourceExists method to ResourceStore
* feat: added resourceExists method to ResourceStore * Merge remote-tracking branch 'origin/main' into feat/add-resourceExists-method-to-ResourceStore * fix: adapted to review * fix: adapted to review
This commit is contained in:
committed by
GitHub
parent
e5b7d99da4
commit
b3f292d718
@@ -17,6 +17,7 @@ describe('A RoutingResourceStore', (): void => {
|
||||
setRepresentation: jest.fn(),
|
||||
modifyResource: jest.fn(),
|
||||
deleteResource: jest.fn(),
|
||||
resourceExists: jest.fn(),
|
||||
};
|
||||
|
||||
rule = new StaticAsyncHandler(true, source);
|
||||
@@ -59,6 +60,12 @@ describe('A RoutingResourceStore', (): void => {
|
||||
expect(source.deleteResource).toHaveBeenLastCalledWith(identifier, 'conditions');
|
||||
});
|
||||
|
||||
it('calls resourceExists on the resulting store.', async(): Promise<void> => {
|
||||
await expect(store.resourceExists(identifier)).resolves.toBeUndefined();
|
||||
expect(source.resourceExists).toHaveBeenCalledTimes(1);
|
||||
expect(source.resourceExists).toHaveBeenLastCalledWith(identifier, undefined);
|
||||
});
|
||||
|
||||
it('throws a 404 if there is no body and no store was found.', async(): Promise<void> => {
|
||||
rule.canHandle = (): any => {
|
||||
throw new NotImplementedHttpError();
|
||||
|
||||
Reference in New Issue
Block a user