Skip to content

Commit

Permalink
chore: implements act from react
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderMelox committed Dec 2, 2024
1 parent 1814dd6 commit 2168cc6
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions packages/ibm-products/src/components/SidePanel/SidePanel.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,11 @@
* LICENSE file in the root directory of this source tree.
*/

import {
fireEvent,
render,
screen,
act,
waitFor,
} from '@testing-library/react';
import { fireEvent, render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { expectMultipleError } from '../../global/js/utils/test-helper';

import React from 'react';
import React, { act } from 'react';
import { Button, TextInput, AILabel, AILabelContent } from '@carbon/react';
import { pkg } from '../../settings';
import uuidv4 from '../../global/js/utils/uuidv4';
Expand Down Expand Up @@ -184,9 +178,9 @@ describe('SidePanel', () => {
);
const outerElement = container.querySelector(`.${blockClass}`);
await act(() => userEvent.click(closeIconButton));
fireEvent.animationStart(outerElement);
await act(() => fireEvent.animationStart(outerElement));
rerender(<SlideIn placement="right" open={false} />);
fireEvent.animationEnd(outerElement);
await act(() => fireEvent.animationEnd(outerElement));
const updatedStyles = getComputedStyle(pageContent);
expect(updatedStyles.marginInlineEnd).toBe('0');
expect(onUnmountFn).toHaveBeenCalled();
Expand Down

0 comments on commit 2168cc6

Please sign in to comment.