Taichi Masuyama 4 лет назад
Родитель
Сommit
2ce59c3c3b
1 измененных файлов с 3 добавлено и 2 удалено
  1. 3 2
      packages/app/test/integration/service/v5-migration.test.js

+ 3 - 2
packages/app/test/integration/service/v5-migration.test.js

@@ -56,9 +56,9 @@ describe('V5 page migration', () => {
           grantedUsers: [testUser1._id],
           grantedUsers: [testUser1._id],
         },
         },
       ]);
       ]);
-      const additionalPages = (await Page.exists({ path: '/' })) ? null : await Page.insertMany([{ path: '/', grant: Page.GRANT_PUBLIC }]);
 
 
-      if (additionalPages != null) {
+      if (await Page.exists({ path: '/' })) {
+        const additionalPages = await Page.insertMany([{ path: '/', grant: Page.GRANT_PUBLIC }]);
         pages = [...additionalPages, ...pages];
         pages = [...additionalPages, ...pages];
       }
       }
 
 
@@ -73,6 +73,7 @@ describe('V5 page migration', () => {
       const migratedPagePaths = migratedPages.filter(doc => doc.parent != null).map(doc => doc.path);
       const migratedPagePaths = migratedPages.filter(doc => doc.parent != null).map(doc => doc.path);
 
 
       const expected = ['/private1', '/dummyParent', '/dummyParent/private1', '/dummyParent/private1/private2', '/dummyParent/private1/private3'];
       const expected = ['/private1', '/dummyParent', '/dummyParent/private1', '/dummyParent/private1/private2', '/dummyParent/private1/private3'];
+      console.log('はあ', migratedPages, migratedPagePaths.sort(), expected.sort());
 
 
       expect(migratedPagePaths.sort()).toStrictEqual(expected.sort());
       expect(migratedPagePaths.sort()).toStrictEqual(expected.sort());
     });
     });