In order to one among the expected value, you can reverse the comparison and test it using toContain
method like
expect(addFeedForm.state().feedfrequency).toEqual('');
addFeedForm.simulate('change');
expect([6, 12, 24]).toContain(addFeedForm.state().feedfrequency)
More Related Contents:
- How do I test axios in Jest?
- How can I use Jest to spy on a method call?
- Simulate a button click in Jest
- Jest – SyntaxError: Cannot use import statement outside a module
- Mock inner axios.create()
- Jest spyOn function called
- How to mock React component methods with jest and enzyme
- The useState set method is not reflecting a change immediately
- How to maintain state after a page refresh in React.js?
- Simple Component is not rendering: React js
- Console.log() after setState() doesn’t return the updated state
- Where should ajax request be made in Flux app?
- How to load image files with webpack file-loader
- Understanding React-Redux and mapStateToProps()
- React.js: Identifying different inputs with one onChange handler
- javascript change background color on click [closed]
- Why do I have to .bind(this) for methods defined in React component class, but not in regular ES6 class
- Support for the experimental syntax ‘jsx’ isn’t currently enabled
- How to update the Context value in a Provider from the Consumer?
- Next.js context provider wrapping App component with page specific layout component giving undefined data
- How to manually invoke Link in React-router?
- Infinite scrolling with React JS
- React Router Dom routes are returning blank pages
- React render() is being called before componentDidMount()
- Component won’t update when a redux state change occurs
- How to properly use useHistory () from react-router-dom?
- React Error: “SharedArrayBuffer is not defined” in Firefox
- passing data from child to parent component – react – via callback function
- FastAPI is not returning cookies to React frontend
- How to set iframe content of a react component