diff --git a/client/components/copy-button/test/index.test.tsx b/client/components/copy-button/test/index.test.tsx index 86555c7da22..7a771a7fe39 100644 --- a/client/components/copy-button/test/index.test.tsx +++ b/client/components/copy-button/test/index.test.tsx @@ -25,14 +25,6 @@ describe( 'CopyButton', () => { } ); describe( 'when the button is clicked', () => { - beforeEach( () => { - jest.useFakeTimers(); - } ); - - afterEach( () => { - jest.useRealTimers(); - } ); - it( 'copies the text to the clipboard and shows copied state', async () => { render( { expect( button ).toHaveClass( 'state--copied' ); act( () => { - jest.advanceTimersByTime( 2000 ); + fireEvent.animationEnd( button ); } ); expect( button ).not.toHaveClass( 'state--copied' );