mirror of
https://github.com/sudoxnym/habitica.git
synced 2026-08-05 12:02:13 +00:00
more casper testing
This commit is contained in:
parent
3d57894b9e
commit
3d18b462ea
1 changed files with 14 additions and 12 deletions
|
|
@ -11,19 +11,21 @@ getUser = () -> casper.evaluate -> window.DERBY.app.model.get('_user')
|
||||||
casper.start url, ->
|
casper.start url, ->
|
||||||
@test.assertTitle "HabitRPG | Gamify Your Life", "[√] Page Title"
|
@test.assertTitle "HabitRPG | Gamify Your Life", "[√] Page Title"
|
||||||
|
|
||||||
# ---------- Remove sample tasks ------------
|
# ---------- Register ------------
|
||||||
casper.then ->
|
casper.then ->
|
||||||
@evaluate ->
|
@fill 'form#derby-auth-register',
|
||||||
model = window.DERBY.app.model
|
username: 'lefnire'
|
||||||
tasks = model.get('_user.tasks')
|
email: 'x@x.com'
|
||||||
_.each tasks, (task) -> model.remove()
|
'email-confirmation': 'x@x.com'
|
||||||
model.set '_user.tasks', {}
|
password: 'habitrpg123'
|
||||||
model.set '_user.habitIds', []
|
, true
|
||||||
model.set '_user.dailyIds', []
|
|
||||||
model.set '_user.todoIds', []
|
# Clear tasks
|
||||||
model.set '_user.rewardIds', []
|
casper.then ->
|
||||||
@then -> @reload()
|
@debugHTML()
|
||||||
# FIXME this function does jack shit
|
@click '#reset-modal button:contains(Reset)'
|
||||||
|
tasks = @evaluate -> window.DERBY.app.model.get('_user.tasks')
|
||||||
|
@test.assertEual tasks.length,0
|
||||||
|
|
||||||
# ---------- Setup Tasks ------------
|
# ---------- Setup Tasks ------------
|
||||||
casper.then ->
|
casper.then ->
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue