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