Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
role="dialog"
style="position: absolute; opacity: 0; transform: translateX(-2em) scale(0) translateZ(0); transform-origin: 0% 50% 0; left: 0px; top: 0px;"
style="position: absolute; opacity: 0.9994144868675858; transform: translateX(-0.00117em) scale(0.9994144868675858) translateZ(0); transform-origin: 0% 50% 0; left: 0px; top: 0px;"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jsnajdr's comment (opacity value) applies here too and we should have the same handling.

tabindex="-1"
>
<div
Expand Down
18 changes: 11 additions & 7 deletions packages/nux/src/components/dot-tip/test/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { act, render, screen } from '@testing-library/react';
import { render, screen, waitFor } from '@testing-library/react';
import userEvent from '@testing-library/user-event';

/**
Expand All @@ -19,8 +19,6 @@ describe( 'DotTip', () => {
</DotTip>
);

await act( () => Promise.resolve() );

expect( screen.queryByRole( 'dialog' ) ).not.toBeInTheDocument();
} );

Expand All @@ -31,9 +29,11 @@ describe( 'DotTip', () => {
</DotTip>
);

await act( () => Promise.resolve() );
const dialog = screen.getByRole( 'dialog' );

await waitFor( () => expect( dialog ).toBePositionedPopover() );

expect( screen.getByRole( 'dialog' ) ).toMatchSnapshot();
expect( dialog ).toMatchSnapshot();
} );

it( 'should call onDismiss when the dismiss button is clicked', async () => {
Expand All @@ -48,7 +48,9 @@ describe( 'DotTip', () => {
</DotTip>
);

await act( () => Promise.resolve() );
const dialog = screen.getByRole( 'dialog' );

await waitFor( () => expect( dialog ).toBePositionedPopover() );

await user.click( screen.getByRole( 'button', { name: 'Got it' } ) );

Expand All @@ -67,7 +69,9 @@ describe( 'DotTip', () => {
</DotTip>
);

await act( () => Promise.resolve() );
const dialog = screen.getByRole( 'dialog' );

await waitFor( () => expect( dialog ).toBePositionedPopover() );

await user.click(
screen.getByRole( 'button', { name: 'Disable tips' } )
Expand Down