Skip to content

Commit f4156a1

Browse files
committed
attempt at fixing the act test
1 parent 450b76a commit f4156a1

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

__tests__/NavBar.test.tsx

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import { Provider } from 'react-redux';
1010
import { configureStore } from '@reduxjs/toolkit';
1111
import rootReducer from '../app/src/redux/reducers/rootReducer';
1212
import { initialState as appStateInitialState } from '../app/src/redux/reducers/slice/appStateSlice';
13-
13+
import { act } from 'react-dom/test-utils';
1414

1515

1616
// Mock the non-serializable HTMLTypes
@@ -117,8 +117,11 @@ describe('NavBar Component', () => {
117117

118118
console.log('After rendering NavBar');
119119

120-
const publishButton = getByText('Publish');
121-
fireEvent.click(publishButton);
120+
await act(async () => {
121+
122+
const publishButton = getByText('Publish');
123+
fireEvent.click(publishButton);
124+
});
122125
});
123126

124127
it('handles publish correctly with new project', async () => {

0 commit comments

Comments
 (0)