Skip to content

Commit

Permalink
test: fix SequenceNavigationTabs test
Browse files Browse the repository at this point in the history
  • Loading branch information
bra-i-am authored and dcoa committed Apr 12, 2024
1 parent 0875936 commit 374f472
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ describe('Sequence Navigation Tabs', () => {
mockData = {
// Blocks are numbered from 1 in the UI, so we're decreasing this by 1 to have correct block's ID in the array.
unitId: unitBlocks[activeBlockNumber - 1].id,
onNavigate: () => {},
onNavigate: () => { },
showCompletion: false,
unitIds: unitBlocks.map(unit => unit.id),
};
Expand All @@ -48,11 +48,10 @@ describe('Sequence Navigation Tabs', () => {

it('renders unit buttons and dropdown button', async () => {
let container = null;
useIndexOfLastVisibleChild.mockReturnValue([-1, null, null]);
const booyah = render(<SequenceNavigationTabs {...mockData} />);
await act(async () => {
useIndexOfLastVisibleChild.mockReturnValue([-1, null, null]);
const booyah = render(<SequenceNavigationTabs {...mockData} />, { wrapWithRouter: true });
container = booyah.container;

const dropdownToggle = container.querySelector('.dropdown-toggle');
// We need to await this click here, which requires us to await the `act` as well above.
// https://github.com/testing-library/react-testing-library/issues/535
Expand Down

0 comments on commit 374f472

Please sign in to comment.