Add errors undefined to tests

- helps with debugging
This commit is contained in:
mattwr18 2019-12-11 12:50:46 +01:00
parent 760fd01715
commit ca9c58c06b

View File

@ -383,7 +383,10 @@ describe('UpdatePost', () => {
}) })
it('updates a post', async () => { it('updates a post', async () => {
const expected = { data: { UpdatePost: { id: 'p9876', content: 'New content' } } } const expected = {
data: { UpdatePost: { id: 'p9876', content: 'New content' } },
errors: undefined,
}
await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject( await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject(
expected, expected,
) )
@ -394,6 +397,7 @@ describe('UpdatePost', () => {
data: { data: {
UpdatePost: { id: 'p9876', content: 'New content', createdAt: expect.any(String) }, UpdatePost: { id: 'p9876', content: 'New content', createdAt: expect.any(String) },
}, },
errors: undefined,
} }
await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject( await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject(
expected, expected,
@ -421,6 +425,7 @@ describe('UpdatePost', () => {
categories: expect.arrayContaining([{ id: 'cat9' }, { id: 'cat4' }, { id: 'cat15' }]), categories: expect.arrayContaining([{ id: 'cat9' }, { id: 'cat4' }, { id: 'cat15' }]),
}, },
}, },
errors: undefined,
} }
await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject( await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject(
expected, expected,
@ -441,6 +446,7 @@ describe('UpdatePost', () => {
categories: expect.arrayContaining([{ id: 'cat27' }]), categories: expect.arrayContaining([{ id: 'cat27' }]),
}, },
}, },
errors: undefined,
} }
await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject( await expect(mutate({ mutation: updatePostMutation, variables })).resolves.toMatchObject(
expected, expected,
@ -722,6 +728,7 @@ describe('UpdatePost', () => {
}, },
], ],
}, },
errors: undefined,
} }
variables = { orderBy: ['pinned_desc', 'createdAt_desc'] } variables = { orderBy: ['pinned_desc', 'createdAt_desc'] }
await expect(query({ query: postOrderingQuery, variables })).resolves.toMatchObject( await expect(query({ query: postOrderingQuery, variables })).resolves.toMatchObject(