Skip to content

Commit

Permalink
Fix failing test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nagesh Pai committed Dec 20, 2024
1 parent 68eb326 commit f0cc6bf
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions client/components/copy-button/test/index.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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(
<CopyButton
Expand Down Expand Up @@ -66,7 +58,7 @@ describe( 'CopyButton', () => {
expect( button ).toHaveClass( 'state--copied' );

act( () => {
jest.advanceTimersByTime( 2000 );
fireEvent.animationEnd( button );
} );

expect( button ).not.toHaveClass( 'state--copied' );
Expand Down

0 comments on commit f0cc6bf

Please sign in to comment.