summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-04-19 11:16:53 -0400
committerWes Bos <wesbos@gmail.com>2018-04-19 11:16:53 -0400
commit990d5ec5af9cea56812e952c3155a346876621cb (patch)
tree90a0e31f95592c09d9957376227443d7467eb679 /frontend/__tests__
parent88ef4bd2df970cb6ea89123ffdd7fcb21dbc0f15 (diff)
custom assertion
Diffstat (limited to 'frontend/__tests__')
-rw-r--r--frontend/__tests__/Order.test.js2
-rw-r--r--frontend/__tests__/ResetRequest.test.js7
2 files changed, 5 insertions, 4 deletions
diff --git a/frontend/__tests__/Order.test.js b/frontend/__tests__/Order.test.js
index 6bcf0b9..e86af78 100644
--- a/frontend/__tests__/Order.test.js
+++ b/frontend/__tests__/Order.test.js
@@ -1,5 +1,5 @@
import React from 'react';
-import { mount } from 'enzyme';
+import { shallow, mount } from 'enzyme';
import wait from 'waait';
import toJSON from 'enzyme-to-json';
import Order from '../components/Order';
diff --git a/frontend/__tests__/ResetRequest.test.js b/frontend/__tests__/ResetRequest.test.js
index 6d8d99f..638a2aa 100644
--- a/frontend/__tests__/ResetRequest.test.js
+++ b/frontend/__tests__/ResetRequest.test.js
@@ -4,6 +4,7 @@ import toJSON from 'enzyme-to-json';
import { ApolloProvider } from 'react-apollo';
import ResetRequest from '../components/ResetRequest';
import mountOptions from './mockMang';
+import wait from 'waait';
describe('<ResetRequest/>', () => {
it('renders and matches snapshot', async () => {
@@ -21,9 +22,9 @@ describe('<ResetRequest/>', () => {
mutation.client.mutate = jest.fn();
mutation.forceUpdate();
wrapper.find('Form').simulate('submit');
- expect(mutation.client.mutate.mock.calls[0][0].variables).toEqual({
- email: 'wesbos@gmail.com',
- });
+
+ expect(mutation.client.mutate).toBeCalledWithVariables({ email: 'wesbos@gmail.com' });
+
expect(toJSON(wrapper)).toMatchSnapshot();
});