kaori 4 лет назад
Родитель
Сommit
213d91c9fe
1 измененных файлов с 10 добавлено и 3 удалено
  1. 10 3
      packages/app/test/integration/service/v5.user-groups.test.ts

+ 10 - 3
packages/app/test/integration/service/v5.user-groups.test.ts

@@ -56,9 +56,9 @@ describe('UserGroupService', () => {
   });
 
   /*
-     * Update UserGroup
-     */
-  test('Can update user group basic info', async() => {
+    * Update UserGroup
+    */
+  test('Can update user group basic info (name, description, parent)', async() => {
     const userGroup = await UserGroup.findOne({ _id: groupId1 });
 
     const newGroupName = 'v5_group1_new';
@@ -77,4 +77,11 @@ describe('UserGroupService', () => {
     await expect(crowi.userGroupService.updateGroup(userGroup._id, 'v5_group2')).rejects.toThrow('The group name is already taken');
   });
 
+  test('Parent will be null If parent group is released', async() => {
+    const userGroup = await UserGroup.findOne({ _id: groupId3 });
+    const updatedUserGroup = await crowi.userGroupService.updateGroup(userGroup._id, userGroup.name, userGroup.description, null);
+
+    expect(updatedUserGroup.parent).toBeNull();
+  });
+
 });