mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
Improve test
This commit is contained in:
parent
32b52efba7
commit
bd84f34a7c
1 changed files with 20 additions and 16 deletions
|
|
@ -155,23 +155,27 @@ describe('Subscriptions API', () => {
|
|||
|
||||
it('should not return other users subscriptions', async () => {
|
||||
// create test user and login
|
||||
const user2 = await createTestUser('fakeUser')
|
||||
await createTestSubscription(
|
||||
user2,
|
||||
'sub_other',
|
||||
undefined,
|
||||
SubscriptionStatus.Unsubscribed,
|
||||
undefined,
|
||||
SubscriptionType.Rss
|
||||
)
|
||||
const res = await graphqlRequest(query, authToken).expect(200)
|
||||
const user2 = await createTestUser('fakeUser2')
|
||||
try {
|
||||
await createTestSubscription(
|
||||
user2,
|
||||
'sub_other',
|
||||
undefined,
|
||||
SubscriptionStatus.Unsubscribed,
|
||||
undefined,
|
||||
SubscriptionType.Rss
|
||||
)
|
||||
const res = await graphqlRequest(query, authToken).expect(200)
|
||||
|
||||
expect(res.body.data.subscriptions.subscriptions).to.eql(
|
||||
subscriptions.map((sub) => ({
|
||||
id: sub.id,
|
||||
name: sub.name,
|
||||
}))
|
||||
)
|
||||
expect(res.body.data.subscriptions.subscriptions).to.eql(
|
||||
subscriptions.map((sub) => ({
|
||||
id: sub.id,
|
||||
name: sub.name,
|
||||
}))
|
||||
)
|
||||
} finally {
|
||||
deleteTestUser(user2.id)
|
||||
}
|
||||
})
|
||||
|
||||
it('responds status code 400 when invalid query', async () => {
|
||||
|
|
|
|||
Loading…
Reference in a new issue