mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 22:57:21 +01:00
bug fix: needed to kill user before checking their exp - tnl() >= 0
when lvl == 0 Conflicts: test/test.coffee
This commit is contained in:
35
test/test.coffee
Normal file
35
test/test.coffee
Normal file
@@ -0,0 +1,35 @@
|
||||
url = 'http://localhost:3000'
|
||||
utils = require('utils')
|
||||
casper = require("casper").create()
|
||||
|
||||
# ---------- Main Stuff ------------
|
||||
|
||||
casper.start url, ->
|
||||
@test.assertTitle "HabitRPG", "homepage title is the one expected"
|
||||
|
||||
|
||||
# ---------- User Death ------------
|
||||
casper.then ->
|
||||
@repeat 55, ->
|
||||
@click '.habits a[data-direction="down"]'
|
||||
|
||||
casper.then ->
|
||||
userStats = @evaluate ->
|
||||
window.DERBY.model.get('_user.stats')
|
||||
utils.dump userStats
|
||||
|
||||
@test.assert(@visible('#dead-modal'), 'Revive Modal Visible')
|
||||
@test.assert(userStats.hp == 0, 'User HP: 0')
|
||||
@test.assert(userStats.lvl == 0, 'User Lvl: 0')
|
||||
@test.assert(userStats.money == 0, 'User GP: 0')
|
||||
|
||||
# ---------- Misc Pages ------------
|
||||
|
||||
# casper.thenOpen "#{url}/terms", ->
|
||||
# @test.assertTitle "Terms Of Use", "terms page works"
|
||||
#
|
||||
# casper.thenOpen "#{url}/privacy", ->
|
||||
# @test.assertTitle "Privacy Policy", "privacy page works"
|
||||
|
||||
casper.run ->
|
||||
@test.renderResults true
|
||||
Reference in New Issue
Block a user