Guest User

Untitled

a guest
Dec 13th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. _handleResults = (results) => {
  2. if (results.length !== undefined && results.length === 0) {
  3. this.setState({ noRecord: true })
  4. }
  5.  
  6. if (this.state.val !== '') {
  7. this.setState({ trainingcatalogues: results })
  8. } else {
  9. this.setState({ trainingcatalogues: this.state.traininglist })
  10. this.setState({ errorMessage: false })
  11. this.setState({ noRecord: false })
  12. }
  13. }
  14.  
  15. it('handles the result', () => {
  16. results="passed";
  17. const wrapper = renderer.create(<Online />).getInstance();
  18. wrapper._handleResults(results);
  19. expect(wrapper.state.noRecord).toBe(true);
  20. });
  21.  
  22. expect(received).toBe(expected)
  23.  
  24. Expected value to be (using ===):
  25. true
  26. Received:
  27. false
Add Comment
Please, Sign In to add comment