fix flaky test

This commit is contained in:
Moriz Wahl 2023-03-16 16:08:33 +01:00
parent da93e7ff83
commit 5f38c74d82
2 changed files with 15 additions and 13 deletions

View File

@ -859,6 +859,6 @@ describe('notifications', () => {
errors: undefined,
})
})
})
})
})
})

View File

@ -397,18 +397,20 @@ describe('given some notifications', () => {
it('returns all as read', async () => {
const response = await mutate({ mutation: markAllAsReadMutation(), variables })
expect(response.data.markAllAsRead).toEqual([
{
createdAt: '2019-08-30T19:33:48.651Z',
from: { __typename: 'Comment', content: 'You have been mentioned in a comment' },
read: true,
},
{
createdAt: '2019-08-31T17:33:48.651Z',
from: { __typename: 'Post', content: 'You have been mentioned in a post' },
read: true,
},
])
expect(response.data.markAllAsRead).toEqual(
expect.arrayContaining([
{
createdAt: '2019-08-30T19:33:48.651Z',
from: { __typename: 'Comment', content: 'You have been mentioned in a comment' },
read: true,
},
{
createdAt: '2019-08-31T17:33:48.651Z',
from: { __typename: 'Post', content: 'You have been mentioned in a post' },
read: true,
},
]),
)
expect(response.errors).toBeUndefined()
})
})