Merge pull request #1679 from Human-Connection/fix_intermittent_backed_specs

Fix intermittent backend specs
This commit is contained in:
mattwr18 2019-09-23 17:38:37 +02:00 committed by GitHub
commit af7ab74e4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -192,7 +192,7 @@ describe('given some notifications', () => {
it('returns only unread notifications of current user', async () => {
const expected = expect.objectContaining({
data: {
notifications: [
notifications: expect.arrayContaining([
{
from: {
__typename: 'Comment',
@ -209,12 +209,15 @@ describe('given some notifications', () => {
read: false,
createdAt: '2019-08-31T17:33:48.651Z',
},
],
]),
},
})
await expect(
query({ query: notificationQuery, variables: { ...variables, read: false } }),
).resolves.toMatchObject(expected)
const response = await query({
query: notificationQuery,
variables: { ...variables, read: false },
})
await expect(response).toMatchObject(expected)
await expect(response.data.notifications.length).toEqual(2) // double-check
})
describe('if a resource gets deleted', () => {