Skip to content

Commit

Permalink
Adds test coverage for Dont Change update type.
Browse files Browse the repository at this point in the history
  • Loading branch information
wjames111 committed Sep 5, 2024
1 parent 4cd0656 commit a97b7e3
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions src/components/Tool/FixCommitmentInfo/FixCommitmentInfo.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,24 @@ describe('FixCommitmentContact', () => {

expect(setContactFocus).toHaveBeenCalled();
});

it('updates contact info with dontChange enum', async () => {
const { findAllByTestId, findByText, getAllByTestId, queryByText } = render(
<Components />,
);

userEvent.click((await findAllByTestId('doNotChangeButton'))[0]);

expect(
await findByText(
"Are you sure you wish to leave Tester 1's commitment information unchanged?",
),
).toBeInTheDocument();

userEvent.click(getAllByTestId('action-button')[1]);

await waitFor(() =>
expect(queryByText('Tester 1')).not.toBeInTheDocument(),
);
});
});

0 comments on commit a97b7e3

Please sign in to comment.