Skip to content

Commit

Permalink
#172 - refactor request table (#233)
Browse files Browse the repository at this point in the history
  • Loading branch information
obr42 authored Nov 14, 2022
1 parent 2ff510d commit b8d422d
Show file tree
Hide file tree
Showing 17 changed files with 249 additions and 606 deletions.
5 changes: 0 additions & 5 deletions src/components/Routes/Routes.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,9 @@ jest.mock('react-router-dom', () => ({
useParams: jest.fn(),
}))

jest.mock('pages/JobIndex/jobIndexHelpers', () => ({
getFormattedTable: jest.fn(),
}))

describe('Routes', () => {
afterAll(() => {
jest.unmock('react-router-dom')
jest.unmock('pages/JobIndex/jobIndexHelpers')
jest.clearAllMocks()
})

Expand Down
4 changes: 2 additions & 2 deletions src/components/SyncUserModal.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ describe('SyncUser Modal', () => {
)
await waitFor(() => {
expect(
screen.getByText('ERROR: Error: Request failed with status code 404'),
screen.getByText('ERROR: Failure to return gardens'),
).toBeInTheDocument()
})
mockAxios.onGet('/api/v1/gardens').reply(200, [TGarden])
Expand All @@ -71,7 +71,7 @@ describe('SyncUser Modal', () => {
fireEvent.click(screen.getByRole('button', { name: 'Submit' }))
await waitFor(() => {
expect(
screen.getByText('ERROR: Error: Request failed with status code 404'),
screen.getByText('ERROR: Failure to sync users'),
).toBeInTheDocument()
})
})
Expand Down
4 changes: 2 additions & 2 deletions src/components/SyncUserModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ const SyncUserModal = ({ open, setOpen }: ModalProps) => {
.catch((e) => {
setAlert({
severity: 'error',
message: e,
message: e.response.data.message || e,
doNotAutoDismiss: true,
})
})
Expand Down Expand Up @@ -146,7 +146,7 @@ const SyncUserModal = ({ open, setOpen }: ModalProps) => {
.catch((e) => {
setAlert({
severity: 'error',
message: e,
message: e.response.data.message || e,
doNotAutoDismiss: true,
})
})
Expand Down
Loading

0 comments on commit b8d422d

Please sign in to comment.