summaryrefslogtreecommitdiffstats
path: root/frontend/__tests__/mockMang.js
diff options
context:
space:
mode:
authorWes Bos <wesbos@gmail.com>2018-05-02 14:45:20 -0400
committerWes Bos <wesbos@gmail.com>2018-05-02 14:45:20 -0400
commitf02a5dc73ac4a14c1d641a6ddbfcd2f1bd2ea0b5 (patch)
tree514905bb030cb87fbbb686034f49e94b67b88853 /frontend/__tests__/mockMang.js
parentae6b07bce815a2dd21741a696eccc64c81587ef4 (diff)
TESTS
Diffstat (limited to 'frontend/__tests__/mockMang.js')
-rw-r--r--frontend/__tests__/mockMang.js27
1 files changed, 24 insertions, 3 deletions
diff --git a/frontend/__tests__/mockMang.js b/frontend/__tests__/mockMang.js
index a6b71af..31d096f 100644
--- a/frontend/__tests__/mockMang.js
+++ b/frontend/__tests__/mockMang.js
@@ -51,9 +51,30 @@ const fakeItem = () => ({
const fakeUser = () => ({
__typename: 'User',
id: '4234',
- name: 'Fakey Mc Fake',
- email: 'fake@fake.com',
+ name: casual.name,
+ email: casual.email,
permissions: ['ADMIN'],
+ orders: [],
+ cart: [],
+});
+
+const fakeOrderItem = () => ({
+ id: casual.uuid,
+ image: `${casual.word}.jpg`,
+ title: casual.words(),
+ price: 4234,
+ quantity: 1,
+ description: casual.words(),
+});
+
+const fakeOrder = () => ({
+ __typename: 'Order',
+ id: 'ord123',
+ charge: 'ch_123',
+ total: 40000,
+ items: [fakeOrderItem(), fakeOrderItem()],
+ createdAt: '2018-04 - 06T19: 24: 16.000Z',
+ user: fakeUser(),
});
const fakeCartItem = overrides => ({
@@ -98,4 +119,4 @@ const mountWithApollo = Component => {
export default mountOptions;
-export { mocked, mountWithApollo, fakeItem, fakeUser, fakeCartItem };
+export { mocked, mountWithApollo, fakeItem, fakeUser, fakeCartItem, fakeOrder, fakeOrderItem };