mirror of
https://github.com/HabitRPG/habitica.git
synced 2025-10-29 12:12:36 +01:00
* make comment more accurate: members are removed, not banned They can rejoin with an invitation in a private group or at any time in a public group. * change windows line breaks to unix line breaks * change flavour text of Golden Knight collection quest to reduce number of testimonies * fix grammatical error noticed by mandyzhou * improve message about not being able to send PMs because we often see people report it as a bug * update instructions for cancelling Google subscriptions (thanks to Scea for noticing) * change Delete Completed on-hover message - fixes #8598 * correct the Orb of Rebirth's text about pets and mounts (they are not locked)
64 lines
2.0 KiB
JavaScript
64 lines
2.0 KiB
JavaScript
describe('Group Tasks Meta Actions Controller', () => {
|
|
let rootScope, scope, user, userSerivce;
|
|
|
|
beforeEach(() => {
|
|
module(function($provide) {
|
|
$provide.value('User', {});
|
|
});
|
|
|
|
inject(($rootScope, $controller) => {
|
|
rootScope = $rootScope;
|
|
|
|
user = specHelper.newUser();
|
|
user._id = "unique-user-id";
|
|
userSerivce = {user: user};
|
|
|
|
scope = $rootScope.$new();
|
|
|
|
scope.task = {
|
|
group: {
|
|
assignedUsers: [],
|
|
approval: {
|
|
required: false,
|
|
}
|
|
},
|
|
};
|
|
scope.task._edit = angular.copy(scope.task);
|
|
|
|
$controller('GroupTaskActionsCtrl', {$scope: scope, User: userSerivce});
|
|
});
|
|
});
|
|
|
|
describe('toggleTaskRequiresApproval', function () {
|
|
it('toggles task approval required field from false to true', function () {
|
|
scope.toggleTaskRequiresApproval();
|
|
expect(scope.task._edit.group.approval.required).to.be.true;
|
|
});
|
|
|
|
it('toggles task approval required field from true to false', function () {
|
|
scope.task._edit.group.approval.required = true;
|
|
scope.toggleTaskRequiresApproval();
|
|
expect(scope.task._edit.group.approval.required).to.be.false;
|
|
});
|
|
});
|
|
|
|
|
|
describe('assign events', function () {
|
|
it('adds a group member to assigned users on "addedGroupMember" event ', () => {
|
|
var testId = 'test-id';
|
|
rootScope.$broadcast('addedGroupMember', testId);
|
|
expect(scope.task.group.assignedUsers).to.contain(testId);
|
|
expect(scope.task._edit.group.assignedUsers).to.contain(testId);
|
|
});
|
|
|
|
it('removes a group member to assigned users on "addedGroupMember" event ', () => {
|
|
var testId = 'test-id';
|
|
scope.task.group.assignedUsers.push(testId);
|
|
scope.task._edit.group.assignedUsers.push(testId);
|
|
rootScope.$broadcast('removedGroupMember', testId);
|
|
expect(scope.task.group.assignedUsers).to.not.contain(testId);
|
|
expect(scope.task._edit.group.assignedUsers).to.not.contain(testId);
|
|
});
|
|
});
|
|
});
|