mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-14 10:12:21 +00:00
Add expectation that push notification gets called when sending gems
This commit is contained in:
parent
3cda9ff820
commit
60857994c3
3 changed files with 14 additions and 3 deletions
|
|
@ -107,6 +107,7 @@
|
|||
"rimraf": "^2.2.8",
|
||||
"shelljs": "^0.4.0",
|
||||
"sinon": "^1.12.2",
|
||||
"sinon-chai": "^2.7.0",
|
||||
"superagent": "~0.15.7",
|
||||
"superagent-defaults": "~0.1.5",
|
||||
"vinyl-source-stream": "^1.0.0",
|
||||
|
|
|
|||
|
|
@ -12,7 +12,8 @@ global.shared = require("../../common")
|
|||
global.User = require("../../website/src/models/user").model
|
||||
|
||||
global.chai = require("chai")
|
||||
global.expect = require("chai").expect
|
||||
chai.use(require("sinon-chai"))
|
||||
global.expect = chai.expect
|
||||
|
||||
##############################
|
||||
# Nconf config
|
||||
|
|
|
|||
|
|
@ -68,7 +68,16 @@ describe "Push-Notifications", ->
|
|||
res = { locals: { user: user } }
|
||||
|
||||
members.sendGift req, res
|
||||
# @TODO Expectations
|
||||
done()
|
||||
|
||||
setTimeout ->
|
||||
# Allow sendGift to finish
|
||||
expect(pushSpy.sendNotify).to.have.been.calledOnce
|
||||
expect(pushSpy.sendNotify).to.have.been.calledWith(
|
||||
recipient,
|
||||
'Gifted Gems',
|
||||
'1 Gems - by ' + user.profile.name
|
||||
)
|
||||
done()
|
||||
, 100
|
||||
|
||||
it "sends a push notification when gifted a subscription"
|
||||
|
|
|
|||
Loading…
Reference in a new issue