Skip to content

Commit

Permalink
adding another test to finish coverage again
Browse files Browse the repository at this point in the history
  • Loading branch information
MorganLove committed Apr 7, 2020
1 parent a71cf35 commit 4aa81e1
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions arlo-client/src/components/Audit/useSetupMenuItems.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,31 @@ describe('useSetupMenuItems', () => {
})
})

it('handles READY_TO_PROCESS response from /jurisdiction/file api', async () => {
apiMock.mockImplementation(
generateApiMock(
{ rounds: [] },
{
file: null,
processing: {
status: FileProcessingStatus.ReadyToProcess,
startedAt: '',
error: null,
completedAt: null,
},
}
)
)
const { result } = renderHook(() =>
useSetupMenuItems('Participants', jest.fn(), '1')
)
act(() => result.current[1]())
await wait(() => {
expect(result.current[0][1].state === 'processing').toBeTruthy()
expect(result.current[0][2].state === 'processing').toBeTruthy()
})
})

it('handles background process timeout', async () => {
const toastSpy = jest.spyOn(toast, 'error').mockImplementation()
const dateIncrementor = (function* incr() {
Expand Down

0 comments on commit 4aa81e1

Please sign in to comment.