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:
@@ -19,7 +19,7 @@ describe('A PatchOperationHandler', (): void => {
|
||||
operation = { method: 'PATCH', target: { path: 'http://test.com/foo' }, body, conditions, preferences: {}};
|
||||
|
||||
store = {
|
||||
resourceExists: jest.fn(),
|
||||
hasResource: jest.fn(),
|
||||
modifyResource: jest.fn(),
|
||||
} as any;
|
||||
|
||||
@@ -47,7 +47,7 @@ describe('A PatchOperationHandler', (): void => {
|
||||
});
|
||||
|
||||
it('returns the correct response if the resource already exists.', async(): Promise<void> => {
|
||||
store.resourceExists.mockResolvedValueOnce(true);
|
||||
store.hasResource.mockResolvedValueOnce(true);
|
||||
const result = await handler.handle({ operation });
|
||||
expect(store.modifyResource).toHaveBeenCalledTimes(1);
|
||||
expect(store.modifyResource).toHaveBeenLastCalledWith(operation.target, body, conditions);
|
||||
|
||||
Reference in New Issue
Block a user