mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-18 07:07:35 +01:00
Ensure correct join/leave button for parties
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
'use strict';
|
||||
|
||||
describe('Groups Controller', function() {
|
||||
var scope, ctrl, groups, user, guild, $rootScope;
|
||||
var scope, ctrl, groups, user, guild, party, $rootScope;
|
||||
|
||||
beforeEach(function() {
|
||||
module(function($provide) {
|
||||
@@ -23,6 +23,19 @@ describe('Groups Controller', function() {
|
||||
});
|
||||
});
|
||||
|
||||
it("isMemberOfGroup returns true if group is the user's party", function() {
|
||||
party = specHelper.newGroup("test-party");
|
||||
party._id = "unique-party-id";
|
||||
party.type = 'party';
|
||||
party.members = []; // Ensure we wouldn't pass automatically.
|
||||
|
||||
var partyStub = sinon.stub(groups,"party", function() {
|
||||
return party;
|
||||
});
|
||||
|
||||
expect(scope.isMemberOfGroup(user._id, party)).to.be.ok;
|
||||
});
|
||||
|
||||
it('isMemberOfGroup returns true if guild is included in myGuilds call', function(){
|
||||
|
||||
guild = specHelper.newGroup("leaders-user-id");
|
||||
|
||||
Reference in New Issue
Block a user