mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
more casper
This commit is contained in:
@@ -125,18 +125,26 @@ casper.then ->
|
||||
@then ->
|
||||
@wait 1050, -> # user's hp is updated after 1s for animation
|
||||
user.after = getUser()
|
||||
tasks =
|
||||
after:
|
||||
@test.assertEqual user.before.id, user.after.id, 'user id equal after cron'
|
||||
tasks.after =
|
||||
daily: @evaluate -> window.DERBY.app.model.get('_dailyList')
|
||||
todo: @evaluate -> window.DERBY.app.model.get('_todoList')
|
||||
|
||||
@test.assertEqual user.before.tasks.length, user.after.tasks.length, "Didn't lose anything on cron"
|
||||
|
||||
#TODO make sure true for all todos
|
||||
todoId = tasks.before.todos[0].id
|
||||
@test.assert user.before.tasks[todoId].value < user.before.tasks[todoId].value, "todo gained value on cron"
|
||||
#TODO make sure true for all dailies
|
||||
dailyId = tasks.before.daily[0].id
|
||||
utils.dump tasks.before.daily
|
||||
utils.dump
|
||||
dailyBefore:user.before.tasks[dailyId].value
|
||||
dailyAfter:user.before.tasks[dailyId].value
|
||||
@test.assert user.before.tasks[dailyId].value < user.before.tasks[dailyId].value, "todo gained value on cron"
|
||||
@test.assert user.before.stats.hp < user.after.stats.hp, 'user lost HP on cron'
|
||||
|
||||
#TODO make sure true for all todos
|
||||
todoId = tasks.before.todo[0].id
|
||||
@test.assert user.before.tasks[todoId].value < user.before.tasks[todoId].value, "todo gained value on cron"
|
||||
|
||||
# ---------- Reset ------------
|
||||
# @then ->
|
||||
# utils.dump @evaluate -> window.DERBY.app.model.get('_user.auth')
|
||||
|
||||
Reference in New Issue
Block a user