Skip to content

Commit

Permalink
Use more realistic variable values
Browse files Browse the repository at this point in the history
  • Loading branch information
mjgiarlo committed May 23, 2019
1 parent 408e8b5 commit 96566df
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions __tests__/components/editor/ImportResourceTemplate.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,9 @@ describe('<ImportResourceTemplate />', () => {
// Set new wrapper in each of these tests because we are changing state
wrapper = shallow(<ImportResourceTemplate.WrappedComponent authenticationState={authenticationState}/>)

wrapper.setState({ createResourceError: ['foo'], message: ['bar'] })
expect(wrapper.state().createResourceError).toEqual(['foo'])
expect(wrapper.state().message).toEqual(['bar'])
wrapper.setState({ createResourceError: ['Could not update resource!'], message: ['Updated http://foo.bar'] })
expect(wrapper.state().createResourceError).toEqual(['Could not update resource!'])
expect(wrapper.state().message).toEqual(['Updated http://foo.bar'])

wrapper.instance().updateStateFromServerResponse({ ok: true, status: 204 }, 0)

Expand All @@ -169,14 +169,14 @@ describe('<ImportResourceTemplate />', () => {
// Set new wrapper in each of these tests because we are changing state
wrapper = shallow(<ImportResourceTemplate.WrappedComponent authenticationState={authenticationState}/>)

wrapper.setState({ createResourceError: ['foo'], message: ['bar'] })
expect(wrapper.state().createResourceError).toEqual(['foo'])
expect(wrapper.state().message).toEqual(['bar'])
wrapper.setState({ createResourceError: ['Could not update resource!'], message: ['Updated http://foo.bar'] })
expect(wrapper.state().createResourceError).toEqual(['Could not update resource!'])
expect(wrapper.state().message).toEqual(['Updated http://foo.bar'])

wrapper.instance().updateStateFromServerResponse({ ok: false, status: 400 }, 0)

expect(wrapper.state().createResourceError).toEqual(['foo'])
expect(wrapper.state().message).toEqual(['bar', 'Unexpected response (400)! '])
expect(wrapper.state().createResourceError).toEqual(['Could not update resource!'])
expect(wrapper.state().message).toEqual(['Updated http://foo.bar', 'Unexpected response (400)! '])
})
})

Expand Down

0 comments on commit 96566df

Please sign in to comment.