mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 15:17:25 +01:00
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:
committed by
Matteo Pagliazzi
parent
7ac67315e6
commit
1a87619bac
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user