Skip to content

Commit

Permalink
feat(metadata-sidebar): unit test
Browse files Browse the repository at this point in the history
  • Loading branch information
karolinaru committed Sep 19, 2024
1 parent 51aa8bb commit d88da16
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ describe('useSidebarMetadataFetcher', () => {
const { result } = setupHook();

expect(result.current.templateInstances).toEqual(mockTemplateInstances);
await waitFor(() => result.current.createMetadataInstance(newTemplateInstance));
await waitFor(() => result.current.createMetadataInstance(newTemplateInstance, jest.fn()));

expect(result.current.templates).toEqual(mockTemplates);
expect(result.current.templateInstances).toEqual([...mockTemplateInstances, newTemplateInstance]);
Expand All @@ -174,7 +174,7 @@ describe('useSidebarMetadataFetcher', () => {
const { result } = setupHook();
expect(result.current.status).toBe(STATUS.SUCCESS);

await waitFor(() => result.current.createMetadataInstance(newTemplateInstance));
await waitFor(() => result.current.createMetadataInstance(newTemplateInstance, jest.fn()));

expect(result.current.status).toBe(STATUS.ERROR);
expect(onErrorMock).toHaveBeenCalledWith(
Expand Down

0 comments on commit d88da16

Please sign in to comment.