mirror of
https://github.com/sudoxnym/habitica-self-host.git
synced 2026-08-01 03:30:25 +00:00
added test for countPets
This commit is contained in:
parent
b89cce001f
commit
b9abc31edb
1 changed files with 13 additions and 0 deletions
|
|
@ -416,3 +416,16 @@ describe 'Helper', ->
|
|||
expect(helpers.startOfDay({now: new Date(2013, 0, 1, 0)}).format('YYYY-MM-DD HH:mm')).to.eql '2013-01-01 00:00'
|
||||
expect(helpers.startOfDay({now: new Date(2013, 0, 1, 5)}).format('YYYY-MM-DD HH:mm')).to.eql '2013-01-01 00:00'
|
||||
expect(helpers.startOfDay({now: new Date(2013, 0, 1, 23, 59, 59)}).format('YYYY-MM-DD HH:mm')).to.eql '2013-01-01 00:00'
|
||||
|
||||
it 'counts pets', ->
|
||||
pets = {}
|
||||
expect(helpers.countPets(null, pets)).to.eql 0
|
||||
expect(helpers.countPets(1, pets)).to.eql 1
|
||||
|
||||
pets = { "Dragon-Red": 1, "Wolf-Base": 2 }
|
||||
expect(helpers.countPets(null, pets)).to.eql 2
|
||||
expect(helpers.countPets(2, pets)).to.eql 2
|
||||
|
||||
pets = { "Wolf-Base": 2, "Wolf-Veteran": 1, "Wolf-Cerberus": 1, "Dragon-Hydra": 1}
|
||||
expect(helpers.countPets(null, pets)).to.eql 1
|
||||
expect(helpers.countPets(_.size(pets), pets)).to.eql 1
|
||||
|
|
|
|||
Loading…
Reference in a new issue