You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import{render,fireEvent,cleanup,waitForElement,prettyDOM}from'react-testing-library';constprops={
...,handleChange: jest.fn(),
...
}it('User Inputs Number and changes dropdown but button is still disabled',()=>{consttree=render(<Component{...props}/>);constinput=tree.getByLabelText(/(NewAmount)/i);fireEvent.change(input);expect(props.handleChange.mock.calls.length).toBe(1);});
react-testing-library
version: 5.4.4react
version: 16.3.2node
version: 10.14.2npm
(oryarn
) version: 1.13.0Relevant code or config:
Here is my tree structure for the related element:
What you did:
yarn jest --watchAll
What happened:
Expected: 1
Received: 0
Problem description:
This should have called my mock function on change.
Suggested solution:
I haven't got one yet - but I will be working towards a solution.
The text was updated successfully, but these errors were encountered: