mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-12 23:35:58 +00:00
Correct backend test
- And added some empty lines for nice formating.
This commit is contained in:
parent
cc99e27fd4
commit
ae4f53e09c
@ -300,6 +300,7 @@ describe('given some notifications', () => {
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
describe('unauthenticated', () => {
|
||||
it('throws authorization error', async () => {
|
||||
const result = await mutate({
|
||||
@ -393,6 +394,7 @@ describe('given some notifications', () => {
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
describe('markAllAsRead', () => {
|
||||
const markAllAsReadMutation = gql`
|
||||
mutation {
|
||||
@ -411,6 +413,7 @@ describe('given some notifications', () => {
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
describe('unauthenticated', () => {
|
||||
it('throws authorization error', async () => {
|
||||
const result = await mutate({
|
||||
@ -432,9 +435,20 @@ describe('given some notifications', () => {
|
||||
}
|
||||
})
|
||||
|
||||
it('returns undefined', async () => {
|
||||
it('returns all as read', async () => {
|
||||
const response = await mutate({ mutation: markAllAsReadMutation, variables })
|
||||
expect(response.data.markAsRead).toEqual(undefined)
|
||||
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.errors).toBeUndefined()
|
||||
})
|
||||
})
|
||||
|
||||
@ -97,6 +97,7 @@ describe('PostIndex', () => {
|
||||
it('refreshes the notificaitons', () => {
|
||||
expect(mocks.$apollo.queries.notifications.refresh).toHaveBeenCalledTimes(1)
|
||||
})
|
||||
|
||||
it('click on `mark all as read` button', async () => {
|
||||
await markAllAsReadButton.trigger('click')
|
||||
expect(mocks.$apollo.mutate).not.toHaveBeenCalled()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user