|
|
@@ -11,6 +11,11 @@ describe('UserGroupService', () => {
|
|
|
let UserGroup;
|
|
|
|
|
|
|
|
|
+ const groupId1 = new mongoose.Types.ObjectId();
|
|
|
+ const groupId2 = new mongoose.Types.ObjectId();
|
|
|
+ const groupId3 = new mongoose.Types.ObjectId();
|
|
|
+
|
|
|
+
|
|
|
beforeAll(async() => {
|
|
|
crowi = await getInstance();
|
|
|
await crowi.configManager.updateConfigsInTheSameNamespace('crowi', { 'app:isV5Compatible': true });
|
|
|
@@ -27,11 +32,6 @@ describe('UserGroupService', () => {
|
|
|
// xssSpy = jest.spyOn(crowi.xss, 'process').mockImplementation(path => path);
|
|
|
|
|
|
|
|
|
- const groupId1 = new mongoose.Types.ObjectId();
|
|
|
- const groupId2 = new mongoose.Types.ObjectId();
|
|
|
- const groupId3 = new mongoose.Types.ObjectId();
|
|
|
-
|
|
|
-
|
|
|
// Create Groups
|
|
|
await UserGroup.insertMany([
|
|
|
// no parent
|
|
|
@@ -63,11 +63,13 @@ describe('UserGroupService', () => {
|
|
|
|
|
|
const newGroupName = 'v5_group1_new';
|
|
|
const newGroupDescription = 'description1_new';
|
|
|
+ const newParentId = groupId2;
|
|
|
|
|
|
- const updatedUserGroup = await crowi.userGroupService.updateGroup(userGroup.id, newGroupName, newGroupDescription);
|
|
|
+ const updatedUserGroup = await crowi.userGroupService.updateGroup(userGroup.id, newGroupName, newGroupDescription, newParentId);
|
|
|
|
|
|
expect(updatedUserGroup.name).toBe(newGroupName);
|
|
|
expect(updatedUserGroup.description).toBe(newGroupDescription);
|
|
|
+ expect(updatedUserGroup.parent).toStrictEqual(newParentId);
|
|
|
});
|
|
|
|
|
|
});
|