Przeglądaj źródła

insert UserGroupRelation data

yohei0125 4 lat temu
rodzic
commit
95668edad3

+ 19 - 7
packages/app/test/integration/service/v5.migration.test.js

@@ -69,6 +69,25 @@ describe('V5 page migration', () => {
         parent: groupIdB,
         parent: groupIdB,
       },
       },
     ]);
     ]);
+
+    await UserGroupRelation.insertMany([
+      {
+        relatedGroup: groupIdIsolate,
+        relatedUser: testUser1._id,
+      },
+      {
+        relatedGroup: groupIdA,
+        relatedUser: testUser1._id,
+      },
+      {
+        relatedGroup: groupIdB,
+        relatedUser: testUser1._id,
+      },
+      {
+        relatedGroup: groupIdC,
+        relatedUser: testUser1._id,
+      },
+    ]);
   });
   });
 
 
   describe('normalizeParentRecursivelyByPages()', () => {
   describe('normalizeParentRecursivelyByPages()', () => {
@@ -254,13 +273,6 @@ describe('V5 page migration', () => {
 
 
     beforeAll(async() => {
     beforeAll(async() => {
 
 
-      await UserGroupRelation.insertMany([
-        {
-          relatedGroup: groupIdIsolate,
-          relatedUser: testUser1._id,
-        },
-      ]);
-
       await Page.insertMany([
       await Page.insertMany([
         {
         {
           _id: pageId1,
           _id: pageId1,