Created
June 13, 2018 16:19
-
-
Save JakeDawkins/2f582ca861ebcbd5c82dde232caa1259 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should show error UI', async () => { | |
const dogMock = { | |
request: { | |
query: GET_DOG_QUERY, | |
variables: { name: 'Buck' }, | |
}, | |
error: new Error('aw shucks'), | |
}; | |
const component = renderer.create( | |
<MockedProvider mocks={[dogMock]} addTypename={false}> | |
<Dog name="Buck" /> | |
</MockedProvider>, | |
); | |
await wait(0); // wait for response | |
const tree = component.toJSON(); | |
expect(tree.children).toContain('Error!'); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment