Skip to content

Commit

Permalink
Fixed failing test on GitHub but not local.
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-bizz committed Aug 13, 2024
1 parent 195907c commit 089ef36
Showing 1 changed file with 13 additions and 12 deletions.
25 changes: 13 additions & 12 deletions src/components/Tool/Appeal/AppealsDetailsPage.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,17 +117,18 @@ const Components = ({ router = defaultRouter }: { router?: object }) => (
describe('AppealsDetailsPage', () => {
describe('Contact drawer', () => {
it('should open and close on List view', async () => {
const { getByText, findByTestId, getByRole, queryByRole } = render(
<Components
router={{
...defaultRouter,
query: {
...defaultRouter.query,
appealId: ['1', 'list'],
},
}}
/>,
);
const { getByText, findByTestId, getByRole, getAllByRole, queryByRole } =
render(
<Components
router={{
...defaultRouter,
query: {
...defaultRouter.query,
appealId: ['1', 'list'],
},
}}
/>,
);

await waitFor(() => expect(getByText('Test Person')).toBeInTheDocument());

Expand All @@ -140,7 +141,7 @@ describe('AppealsDetailsPage', () => {
expect(getByRole('tab', { name: 'Tasks' })).toBeInTheDocument(),
);

userEvent.click(getByRole('img', { name: 'Close' }));
userEvent.click(getAllByRole('img', { name: 'Close' })[0]);

await waitFor(() =>
expect(queryByRole('tab', { name: 'Tasks' })).not.toBeInTheDocument(),
Expand Down

0 comments on commit 089ef36

Please sign in to comment.