mirror of
https://github.com/CommunitySolidServer/CommunitySolidServer.git
synced 2024-10-03 14:55:10 +00:00
refactor: Rename resourceExists to hasResource
The function was also moved to the smaller interface ResourceSet.
This commit is contained in:
@@ -17,7 +17,7 @@ describe('A RoutingResourceStore', (): void => {
|
||||
setRepresentation: jest.fn(),
|
||||
modifyResource: jest.fn(),
|
||||
deleteResource: jest.fn(),
|
||||
resourceExists: jest.fn(),
|
||||
hasResource: jest.fn(),
|
||||
};
|
||||
|
||||
rule = new StaticAsyncHandler(true, source);
|
||||
@@ -60,10 +60,10 @@ 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('calls hasResource on the resulting store.', async(): Promise<void> => {
|
||||
await expect(store.hasResource(identifier)).resolves.toBeUndefined();
|
||||
expect(source.hasResource).toHaveBeenCalledTimes(1);
|
||||
expect(source.hasResource).toHaveBeenLastCalledWith(identifier);
|
||||
});
|
||||
|
||||
it('throws a 404 if there is no body and no store was found.', async(): Promise<void> => {
|
||||
|
||||
Reference in New Issue
Block a user