Api v3 party quest fixes (#7341)

* Fix display of add challenge message when group challenges are empty

* Fixed forced quest start to update quest without reload

* Fixed needing to reload when accepting party invite

* Fix group leave and join reload

* Fixed leave current party and join another

* Updated party tests
This commit is contained in:
Keith Holliday
2016-05-18 10:22:32 +01:00
committed by Matteo Pagliazzi
parent 7ac67315e6
commit 1a87619bac
8 changed files with 35 additions and 25 deletions

View File

@@ -423,7 +423,9 @@ describe("Party Controller", function() {
describe('#leaveOldPartyAndJoinNewParty', function() {
beforeEach(function() {
sandbox.stub(scope, 'join');
sandbox.stub(groups.Group, 'leave').yields();
groups.data.party = { _id: 'old-party' };
var groupLeave = sandbox.stub(groups.Group, 'leave');
groupLeave.returns(Promise.resolve({}));
sandbox.stub(groups, 'party').returns({
_id: 'old-party'
});
@@ -441,20 +443,17 @@ describe("Party Controller", function() {
scope.leaveOldPartyAndJoinNewParty('some-id', 'some-name');
expect(groups.Group.leave).to.be.calledOnce;
expect(groups.Group.leave).to.be.calledWith({
gid: 'old-party',
keep: false
});
expect(groups.Group.leave).to.be.calledWith('old-party', false);
});
it('joins the new party', function() {
it('joins the new party', function(done) {
scope.leaveOldPartyAndJoinNewParty('some-id', 'some-name');
expect(scope.join).to.be.calledOnce;
expect(scope.join).to.be.calledWith({
id: 'some-id',
name: 'some-name'
});
setTimeout(function() {
expect(scope.join).to.be.calledOnce;
expect(scope.join).to.be.calledWith({id: 'some-id', name: 'some-name'});
done();
}, 1000);
});
});