Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Commit

Permalink
Fix failed JS test
Browse files Browse the repository at this point in the history
Use fireEvent instead of
user to input the color.
  • Loading branch information
kienstra committed Aug 7, 2020
1 parent adb761a commit 0445808
Show file tree
Hide file tree
Showing 2 changed files with 192 additions and 183 deletions.
4 changes: 2 additions & 2 deletions js/blocks/controls/test/color.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* External dependencies
*/
import { render } from '@testing-library/react';
import { fireEvent, render } from '@testing-library/react';
import user from '@testing-library/user-event';

/**
Expand Down Expand Up @@ -33,6 +33,6 @@ test( 'color control', async () => {
// On entering a new color, it should be sent to the onChange handler.
const enteredColor = '#fff';
user.clear( input );
user.type( input, enteredColor );
fireEvent.change( input, { target: { value: enteredColor } } );
expect( mockOnChange ).toHaveBeenCalledWith( enteredColor );
} );
Loading

0 comments on commit 0445808

Please sign in to comment.