Skip to content

Commit

Permalink
Use React Testing Library act
Browse files Browse the repository at this point in the history
  • Loading branch information
atomicgamedeveloper committed Jul 24, 2024
1 parent 1853d66 commit e489375
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions client/test/unitTests/Page/Menu.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as React from 'react';
import { fireEvent, render, screen } from '@testing-library/react';
import { fireEvent, render, screen, act } from '@testing-library/react';
import MiniDrawer from 'page/Menu';
import { MemoryRouter } from 'react-router-dom';
import { Provider } from 'react-redux';
Expand Down Expand Up @@ -62,13 +62,13 @@ describe('Menu', () => {
const buttonsDiv = closestDiv(libraryButton);
expect(buttonsDiv).toHaveStyle('width:calc(56px + 1px);');

React.act(() => {
act(() => {
store.dispatch(openMenu());
});

expect(buttonsDiv).toHaveStyle('width:240px');

React.act(() => {
act(() => {
store.dispatch(closeMenu());
});

Expand Down

0 comments on commit e489375

Please sign in to comment.