mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-17 06:37:23 +01:00
Fixed test broken by part sync change (#7195)
This commit is contained in:
committed by
Matteo Pagliazzi
parent
bb1cb3397e
commit
ca6dca5fd0
@@ -5,13 +5,12 @@ describe('Header Controller', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
module(function($provide) {
|
module(function($provide) {
|
||||||
$provide.value('User', {});
|
user = specHelper.newUser();
|
||||||
|
user._id = "unique-user-id"
|
||||||
|
$provide.value('User', {user: user});
|
||||||
});
|
});
|
||||||
|
|
||||||
inject(function(_$rootScope_, _$controller_, _$location_){
|
inject(function(_$rootScope_, _$controller_, _$location_){
|
||||||
user = specHelper.newUser();
|
|
||||||
user._id = "unique-user-id"
|
|
||||||
|
|
||||||
scope = _$rootScope_.$new();
|
scope = _$rootScope_.$new();
|
||||||
$rootScope = _$rootScope_;
|
$rootScope = _$rootScope_;
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ describe("Party Controller", function() {
|
|||||||
|
|
||||||
context('party has 1 member', function() {
|
context('party has 1 member', function() {
|
||||||
it('awards no new achievements', function() {
|
it('awards no new achievements', function() {
|
||||||
groupResponse = {data: {data: {_id: "test", type: "party", memberCount: 1}}};
|
groupResponse = {_id: "test", type: "party", memberCount: 1};
|
||||||
|
|
||||||
initializeControllerWithStubbedState();
|
initializeControllerWithStubbedState();
|
||||||
|
|
||||||
@@ -73,7 +73,7 @@ describe("Party Controller", function() {
|
|||||||
context('party has 2 members', function() {
|
context('party has 2 members', function() {
|
||||||
context('user does not have "Party Up" achievement', function() {
|
context('user does not have "Party Up" achievement', function() {
|
||||||
it('awards "Party Up" achievement', function(done) {
|
it('awards "Party Up" achievement', function(done) {
|
||||||
groupResponse = {data: {data: {_id: "test", type: "party", memberCount: 2}}};
|
groupResponse = {_id: "test", type: "party", memberCount: 2};
|
||||||
|
|
||||||
initializeControllerWithStubbedState();
|
initializeControllerWithStubbedState();
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ describe("Party Controller", function() {
|
|||||||
context('party has 4 members', function() {
|
context('party has 4 members', function() {
|
||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
groupResponse = {data: {data: {_id: "test", type: "party", memberCount: 4}}};
|
groupResponse = {_id: "test", type: "party", memberCount: 4};
|
||||||
});
|
});
|
||||||
|
|
||||||
context('user has "Party Up" but not "Party On" achievement', function() {
|
context('user has "Party Up" but not "Party On" achievement', function() {
|
||||||
|
|||||||
@@ -6,14 +6,16 @@ describe('groupServices', function() {
|
|||||||
|
|
||||||
beforeEach(function() {
|
beforeEach(function() {
|
||||||
module(function($provide) {
|
module(function($provide) {
|
||||||
$provide.value('User', {user:user});
|
user = specHelper.newUser();
|
||||||
|
user._id = "unique-user-id"
|
||||||
|
user.party._id = 'unique-party-id';
|
||||||
|
user.sync = function(){};
|
||||||
|
$provide.value('User', {user: user});
|
||||||
});
|
});
|
||||||
|
|
||||||
inject(function(_$httpBackend_, Groups, User) {
|
inject(function(_$httpBackend_, Groups, User) {
|
||||||
$httpBackend = _$httpBackend_;
|
$httpBackend = _$httpBackend_;
|
||||||
groups = Groups;
|
groups = Groups;
|
||||||
user = User;
|
|
||||||
user.sync = function(){};
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -152,6 +154,6 @@ describe('groupServices', function() {
|
|||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
|
|
||||||
$httpBackend.flush();
|
$httpBackend.flush()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ describe('Quests Service', function() {
|
|||||||
user.ops = {
|
user.ops = {
|
||||||
buyQuest: sandbox.spy()
|
buyQuest: sandbox.spy()
|
||||||
};
|
};
|
||||||
|
user.party._id = 'unique-party-id';
|
||||||
|
|
||||||
user.achievements.quests = {};
|
user.achievements.quests = {};
|
||||||
quest = {lvl:20};
|
quest = {lvl:20};
|
||||||
|
|||||||
Reference in New Issue
Block a user