diff options
| author | Wes Bos <wesbos@gmail.com> | 2018-04-20 12:38:03 -0400 |
|---|---|---|
| committer | Wes Bos <wesbos@gmail.com> | 2018-04-20 12:38:03 -0400 |
| commit | 13d263b7c088690b77d964f84fac454922b57ef8 (patch) | |
| tree | 4f08f52cfb1aa8a9c67c7e1ef62802006426145f /frontend/__tests__/mockMang.js | |
| parent | 0f6582b270801ee187a73ac25d44338f31cbd883 (diff) | |
RemoveFromCart tests
Diffstat (limited to 'frontend/__tests__/mockMang.js')
| -rw-r--r-- | frontend/__tests__/mockMang.js | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/frontend/__tests__/mockMang.js b/frontend/__tests__/mockMang.js index 3dba703..6922601 100644 --- a/frontend/__tests__/mockMang.js +++ b/frontend/__tests__/mockMang.js @@ -3,6 +3,8 @@ import { makeExecutableSchema } from 'graphql-tools'; import MockClient from 'graphql-mock'; import casual from 'casual'; import PropTypes from 'prop-types'; +import { ApolloProvider } from 'react-apollo'; +import { mount } from 'enzyme'; // seed it so we get consistent results casual.seed(777); @@ -61,4 +63,11 @@ const mountOptions = { }, }; +const mountWithApollo = (Component, props) => { + const wrapper = mount(<ApolloProvider client={mocked.client}>{Component}</ApolloProvider>); + return wrapper.children(); +}; + export default mountOptions; + +export { mocked, mountWithApollo }; |
