From 7d7c7c0c526fa87a5e8b639133c06ca934286447 Mon Sep 17 00:00:00 2001 From: bra-i-am Date: Wed, 10 Jan 2024 09:46:01 -0500 Subject: [PATCH] fix: test wasn't passing correctly --- .../sequence-navigation/SequenceNavigationTabs.test.jsx | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/courseware/course/sequence/sequence-navigation/SequenceNavigationTabs.test.jsx b/src/courseware/course/sequence/sequence-navigation/SequenceNavigationTabs.test.jsx index 2742eb9092..f6f81544e5 100644 --- a/src/courseware/course/sequence/sequence-navigation/SequenceNavigationTabs.test.jsx +++ b/src/courseware/course/sequence/sequence-navigation/SequenceNavigationTabs.test.jsx @@ -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(); await act(async () => { - useIndexOfLastVisibleChild.mockReturnValue([-1, null, null]); - const booyah = render(); 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