mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-12-16 22:27:26 +01:00
Group plans misc fixes (#8388)
* Added notification for approval request in the group leaders language * Added test for group task meta actions. Added sync when user claims * Added tests for group task actions. Ensured assigned members are synce when added or removed * Fixed approval required toggle * Added support for users with comma in their name * Fixed sync issue when user is approved and reloads the website * Added advance options for group rewards * Added back ticks to group claim message * Fixed disappearing tasks that need approval * Up chat limit to 400 for subbed groups * Fixed line endings * Updated activie subscription check * Added group isSubscribed function * Changed to isAfter
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
describe('Group Task Actions Controller', () => {
|
||||
let scope, user, userSerivce;
|
||||
|
||||
beforeEach(() => {
|
||||
module(function($provide) {
|
||||
$provide.value('User', {});
|
||||
});
|
||||
|
||||
inject(($rootScope, $controller) => {
|
||||
user = specHelper.newUser();
|
||||
user._id = "unique-user-id";
|
||||
userSerivce = {user: user};
|
||||
userSerivce.sync = sandbox.stub();
|
||||
|
||||
scope = $rootScope.$new();
|
||||
|
||||
$controller('GroupTaskMetaActionsCtrl', {$scope: scope, User: userSerivce});
|
||||
|
||||
scope.task = {
|
||||
group: {
|
||||
assignedUsers: [],
|
||||
},
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
describe('claim', () => {
|
||||
beforeEach(() => {
|
||||
sandbox.stub(window, 'confirm').returns(true);
|
||||
});
|
||||
|
||||
it('adds user to assigned users of scope task ', () => {
|
||||
scope.claim();
|
||||
expect(scope.task.group.assignedUsers).to.contain(user._id);
|
||||
});
|
||||
|
||||
it('syncs user tasks ', () => {
|
||||
scope.claim();
|
||||
expect(userSerivce.sync).to.be.calledOnce;
|
||||
});
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user