mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-07-31 19:20:25 +00:00
add lastDrop to helpers.newUser
This commit is contained in:
parent
dd79638bac
commit
ecc8ff740e
2 changed files with 10 additions and 3 deletions
|
|
@ -76,7 +76,7 @@ module.exports =
|
|||
# _id / id handled by Racer
|
||||
stats: { gp: 0, exp: 0, lvl: 1, hp: 50 }
|
||||
invitations: {party:null, guilds: []}
|
||||
items: { weapon: 0, armor: 0, head: 0, shield: 0 }
|
||||
items: { weapon: 0, armor: 0, head: 0, shield: 0, lastDrop: { date: +new Date, count: 0 } }
|
||||
preferences: { gender: 'm', skin: 'white', hair: 'blond', armorSet: 'v1', dayStart:0, showHelm: true }
|
||||
apiToken: uuid() # set in newUserObject below
|
||||
lastCron: +new Date #this will be replaced with `+new Date` on first run
|
||||
|
|
|
|||
|
|
@ -75,7 +75,11 @@ describe 'User', ->
|
|||
it 'sets correct user defaults', ->
|
||||
user = helpers.newUser()
|
||||
expect(user.stats).to.eql { gp: 0, exp: 0, lvl: 1, hp: 50 }
|
||||
expect(user.items).to.eql { weapon: 0, armor: 0, head: 0, shield: 0 }
|
||||
expect(user.items.weapon).to.eql 0
|
||||
expect(user.items.armor).to.eql 0
|
||||
expect(user.items.head).to.eql 0
|
||||
expect(user.items.shield).to.eql 0
|
||||
expect(user.items.lastDrop.count).to.eql 0
|
||||
expect(user.preferences).to.eql { gender: 'm', skin: 'white', hair: 'blond', armorSet: 'v1', dayStart:0, showHelm: true }
|
||||
expect(user.balance).to.eql 0
|
||||
expect(user.lastCron).to.be.greaterThan 0
|
||||
|
|
@ -95,7 +99,10 @@ describe 'User', ->
|
|||
user.weapon = 1
|
||||
algos.revive user
|
||||
expect(user.stats).to.eql { gp: 0, exp: 0, lvl: 1, hp: 50 }
|
||||
expect(user.items).to.eql { weapon: 0, armor: 0, head: 0, shield: 0 }
|
||||
expect(user.items.weapon).to.eql 0
|
||||
expect(user.items.armor).to.eql 0
|
||||
expect(user.items.head).to.eql 0
|
||||
expect(user.items.shield).to.eql 0
|
||||
|
||||
describe 'store', ->
|
||||
it 'recovers hp buying potions', ->
|
||||
|
|
|
|||
Loading…
Reference in a new issue