Skip to content

Commit

Permalink
Mock contact status
Browse files Browse the repository at this point in the history
  • Loading branch information
canac committed Oct 7, 2024
1 parent a808a08 commit 58aa8a7
Showing 1 changed file with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { dispatch } from 'src/lib/analytics';
import theme from 'src/theme';
import useTaskModal from '../../../../../hooks/useTaskModal';
import { TaskModalEnum } from '../../TaskModal';
import { ContactStatusQuery } from '../Inputs/SuggestedContactStatus/SuggestedContactStatus.generated';
import { taskModalTests } from '../TaskModalTests';
import TaskModalCompleteForm from './TaskModalCompleteForm';

Expand Down Expand Up @@ -76,9 +77,15 @@ const Components = ({ mocks = {}, taskOverrides, props }: ComponentsProps) => (
<ThemeProvider theme={theme}>
<GqlMockedProvider<{
LoadConstant: LoadConstantsQuery;
ContactStatus: ContactStatusQuery;
}>
mocks={{
LoadConstants: loadConstantsMockData,
ContactStatus: {
contact: {
status: null,
},
},
...mocks,
}}
onCall={mutationSpy}
Expand Down Expand Up @@ -167,11 +174,9 @@ describe('TaskModalCompleteForm', () => {
);
});

expect(
await findByText('Initiate for Appointment', {}, { timeout: 3000 }),
).toBeInTheDocument();
expect(await findByText('Initiate for Appointment')).toBeInTheDocument();
expect(getByText("Change the contact's status to:")).toBeInTheDocument();
}, 15000);
});

it('does not render suggested status when the Phase Constant does not provide a suggested status', async () => {
const { getByRole, queryByText, findByRole } = render(
Expand Down Expand Up @@ -396,9 +401,7 @@ describe('TaskModalCompleteForm', () => {
userEvent.click(await findByRole('combobox', { name: 'Next Action' }));
userEvent.click(await findByRole('option', { name: 'Thank You Note' }));

expect(
await findByText('Partner - Special', {}, { timeout: 3000 }),
).toBeInTheDocument();
expect(await findByText('Partner - Special')).toBeInTheDocument();
userEvent.click(getByText("Change the contact's status to:"));

userEvent.click(getByText('Save'));
Expand Down

0 comments on commit 58aa8a7

Please sign in to comment.