Skip to content

Instantly share code, notes, and snippets.

@JakeDawkins
Created June 13, 2018 16:19
Show Gist options
  • Save JakeDawkins/2f582ca861ebcbd5c82dde232caa1259 to your computer and use it in GitHub Desktop.
Save JakeDawkins/2f582ca861ebcbd5c82dde232caa1259 to your computer and use it in GitHub Desktop.
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