diff --git a/packages/nux/src/components/dot-tip/test/__snapshots__/index.js.snap b/packages/nux/src/components/dot-tip/test/__snapshots__/index.js.snap index 7d87549eac0aa1..d4f4c7f154652b 100644 --- a/packages/nux/src/components/dot-tip/test/__snapshots__/index.js.snap +++ b/packages/nux/src/components/dot-tip/test/__snapshots__/index.js.snap @@ -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;" tabindex="-1" >
{ ); - await act( () => Promise.resolve() ); - expect( screen.queryByRole( 'dialog' ) ).not.toBeInTheDocument(); } ); @@ -31,9 +29,11 @@ describe( '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 () => { @@ -48,7 +48,9 @@ describe( 'DotTip', () => { ); - await act( () => Promise.resolve() ); + const dialog = screen.getByRole( 'dialog' ); + + await waitFor( () => expect( dialog ).toBePositionedPopover() ); await user.click( screen.getByRole( 'button', { name: 'Got it' } ) ); @@ -67,7 +69,9 @@ describe( 'DotTip', () => { ); - await act( () => Promise.resolve() ); + const dialog = screen.getByRole( 'dialog' ); + + await waitFor( () => expect( dialog ).toBePositionedPopover() ); await user.click( screen.getByRole( 'button', { name: 'Disable tips' } )