mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 14:47:53 +01:00
Using newUser helper in tests
This commit is contained in:
@@ -5,7 +5,7 @@ describe('Filters Controller', function() {
|
|||||||
|
|
||||||
beforeEach(module('habitrpg'));
|
beforeEach(module('habitrpg'));
|
||||||
beforeEach(inject(function($rootScope, $controller, Shared) {
|
beforeEach(inject(function($rootScope, $controller, Shared) {
|
||||||
user = {filters: {}};
|
user = specHelper.newUser();
|
||||||
Shared.wrap(user);
|
Shared.wrap(user);
|
||||||
scope = $rootScope.$new();
|
scope = $rootScope.$new();
|
||||||
$controller('FiltersCtrl', {$scope: scope, User: {user: user}});
|
$controller('FiltersCtrl', {$scope: scope, User: {user: user}});
|
||||||
|
|||||||
@@ -5,11 +5,9 @@ describe('Inventory Controller', function() {
|
|||||||
|
|
||||||
beforeEach(module('habitrpg'));
|
beforeEach(module('habitrpg'));
|
||||||
beforeEach(inject(function($rootScope, $controller, Shared){
|
beforeEach(inject(function($rootScope, $controller, Shared){
|
||||||
user = {
|
user = specHelper.newUser();
|
||||||
balance: 4,
|
user.balance = 4,
|
||||||
stats: {gp: 0},
|
user.items = {eggs: {Cactus: 1}, hatchingPotions: {Base: 1}, food: {Meat: 1}, pets: {}};
|
||||||
items: {eggs: {Cactus: 1}, hatchingPotions: {Base: 1}, food: {Meat: 1}, pets: {}},
|
|
||||||
};
|
|
||||||
Shared.wrap(user);
|
Shared.wrap(user);
|
||||||
var mockWindow = {
|
var mockWindow = {
|
||||||
confirm: function(msg){
|
confirm: function(msg){
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ specHelper = {
|
|||||||
var buffs = {per:0, int:0, con:0, str:0, stealth: 0, streaks: false};
|
var buffs = {per:0, int:0, con:0, str:0, stealth: 0, streaks: false};
|
||||||
user = {
|
user = {
|
||||||
auth:{timestamps: {}},
|
auth:{timestamps: {}},
|
||||||
stats: {str:1, con:1, per:1, int:1, mp: 32, class: 'warrior', buffs: buffs},
|
stats: {str:1, con:1, per:1, int:1, mp: 32, class: 'warrior', buffs: buffs, gp: 0},
|
||||||
items:{
|
items:{
|
||||||
lastDrop:{count: 0},
|
lastDrop:{count: 0},
|
||||||
hatchingPotions: {},
|
hatchingPotions: {},
|
||||||
@@ -22,6 +22,7 @@ specHelper = {
|
|||||||
todos: [],
|
todos: [],
|
||||||
rewards: [],
|
rewards: [],
|
||||||
flags: {},
|
flags: {},
|
||||||
|
filters: {},
|
||||||
achievements: {},
|
achievements: {},
|
||||||
};
|
};
|
||||||
return user;
|
return user;
|
||||||
|
|||||||
Reference in New Issue
Block a user