Skip to content

Commit

Permalink
wip: debugging unit test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
sirpy committed May 24, 2020
1 parent 8c08299 commit 74c878b
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/server/storage/__tests__/storageAPI.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,14 +98,10 @@ describe('storageAPI', () => {
.post('/user/enqueue')
.set('Authorization', `Bearer ${token}`)
.send()

const res = await request(server)
.post('/admin/queue')
.send({ allow: 2, password: 'password' })
const updated = await PropsModel.findOne({ name: 'claimQueueAllowed' })
const stillPending = await UserDBPrivate.model.count({ 'claimQueue.status': 'pending' })
expect(stillPending).toEqual(1)
expect(updated.value).toEqual(3)
expect(res.body.pendingUsers).not.toEqual(expect.arrayContaining([{ mauticId: '3' }]))
expect(res.body).toMatchObject({
ok: 1,
newAllowed: 3,
Expand All @@ -116,5 +112,12 @@ describe('storageAPI', () => {
]),
stillPending: 1
})
expect(res.body.pendingUsers).not.toEqual(expect.arrayContaining([{ mauticId: '3' }]))

const updated = await PropsModel.findOne({ name: 'claimQueueAllowed' })
expect(updated.value).toEqual(3)

const stillPending = await UserDBPrivate.model.count({ 'claimQueue.status': 'pending' })
expect(stillPending).toEqual(1)
})
})

0 comments on commit 74c878b

Please sign in to comment.