Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.73 KB | None | 0 0
  1. dispatchSearch() {
  2. if (!this.isSearchButtonDisabled()) {
  3. const searchTerms = { [this.state.searchType]: this.state.searchTerm };
  4. this.props.searchParameters(searchTerms, '', '', this.state.allOpenStoresSearchTerms.selectedOption);
  5. }
  6. }
  7.  
  8. it('should dispatch a keycode when keycode value is set', () => {
  9. component.setState({ searchTerm: 'some-value', allOpenStoresSearchTerms: {selectedOption: {value: 'true', label: 'Open Stores'}} });
  10. component.find('SearchInput').props().onKeyPress({ key: 'Enter' });
  11. expect(dispatchEvent).toBeCalled();
  12. expect(dispatchEvent).toBeCalledWith({ simsKeycode: 'some-value', allOpenStoresSearchTerms: {selectedOption: {value: 'true', label: 'Open Stores'}} });
  13. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement