From f0cc6bfa0acb38f0f71bc9f9cb3574fa64ea8e8f Mon Sep 17 00:00:00 2001 From: Nagesh Pai Date: Fri, 20 Dec 2024 10:54:09 +0530 Subject: [PATCH] Fix failing test --- client/components/copy-button/test/index.test.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) 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' );