mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-04 09:39:23 +00:00
todos tests (stub)
This commit is contained in:
parent
4a7b5183f8
commit
d5f36a291c
1 changed files with 16 additions and 5 deletions
|
|
@ -1,18 +1,29 @@
|
|||
helper = new require('./test/casper/helpers')()
|
||||
casper = helper.casper
|
||||
utils = helper.utils
|
||||
url = helper.url
|
||||
|
||||
casper.start url + '/?play=1'
|
||||
|
||||
# ---------- Todos ------------
|
||||
casper.then ->
|
||||
reset()
|
||||
addTasks()
|
||||
helper.reset()
|
||||
helper.addTasks()
|
||||
|
||||
# Gained exp on +daily
|
||||
casper.then ->
|
||||
user = userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
|
||||
user = helper.userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
|
||||
@test.assertEquals user.before.stats.hp, user.after.stats.hp, '+daily =hp'
|
||||
@test.assert user.before.stats.exp < user.after.stats.exp, '+daily +exp'
|
||||
@test.assert user.before.stats.money < user.after.stats.money, '+daily +money'
|
||||
|
||||
# -daily acts as undo
|
||||
casper.then ->
|
||||
user = userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
|
||||
user = helper.userBeforeAfter (-> casper.click '.todos input[type="checkbox"]')
|
||||
@test.assertEquals user.before.stats.hp, user.after.stats.hp, '-daily =hp'
|
||||
@test.assert user.before.stats.exp > user.after.stats.exp, '-daily -exp'
|
||||
@test.assert user.before.stats.money > user.after.stats.money, '-daily -money'
|
||||
@test.assert user.before.stats.money > user.after.stats.money, '-daily -money'
|
||||
|
||||
# ---------- Run ------------
|
||||
casper.run ->
|
||||
casper.test.renderResults true
|
||||
Loading…
Reference in a new issue