Skip to content

Commit

Permalink
Remove fake timers from DotTip unit tests. Fixes popover act warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsnajdr committed Aug 29, 2023
1 parent 0af6e87 commit 3d62c20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ exports[`DotTip should render correctly 1`] = `
aria-label="Editor tips"
class="components-popover nux-dot-tip is-positioned"
role="dialog"
style="position: absolute; top: 0px; left: 0px; opacity: 1; transform: none; transform-origin: 0% 50% 0;"
style="position: absolute; top: 0px; left: 0px; opacity: 0; transform: translateX(0px) translateY(0px) translateX(-2em) scale(0) translateZ(0); transform-origin: 0% 50% 0;"
tabindex="-1"
>
<div
Expand Down
16 changes: 2 additions & 14 deletions packages/nux/src/components/dot-tip/test/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,6 @@ import userEvent from '@testing-library/user-event';
import { DotTip } from '..';

describe( 'DotTip', () => {
beforeEach( () => {
jest.useFakeTimers();
} );

afterEach( () => {
jest.useRealTimers();
} );

it( 'should not render anything if invisible', () => {
render(
<DotTip>
Expand All @@ -43,9 +35,7 @@ describe( 'DotTip', () => {
} );

it( 'should call onDismiss when the dismiss button is clicked', async () => {
const user = userEvent.setup( {
advanceTimers: jest.advanceTimersByTime,
} );
const user = userEvent.setup();
const onDismiss = jest.fn();

render(
Expand All @@ -64,9 +54,7 @@ describe( 'DotTip', () => {
} );

it( 'should call onDisable when the X button is clicked', async () => {
const user = userEvent.setup( {
advanceTimers: jest.advanceTimersByTime,
} );
const user = userEvent.setup();
const onDisable = jest.fn();

render(
Expand Down

0 comments on commit 3d62c20

Please sign in to comment.