zahmis 5 лет назад
Родитель
Сommit
f22293c9a4
1 измененных файлов с 6 добавлено и 6 удалено
  1. 6 6
      src/test/service/page.test.js

+ 6 - 6
src/test/service/page.test.js

@@ -338,8 +338,7 @@ describe('PageService', () => {
 
 
     test('duplicateTags()', async() => {
     test('duplicateTags()', async() => {
 
 
-      const newPageDummy = [];
-      newPageDummy.push({
+      const newPageDummy = [{
         _id: '60110bdd85339d7dc732dddd',
         _id: '60110bdd85339d7dc732dddd',
         path: '/newPageDummyPath',
         path: '/newPageDummyPath',
         creator: parentForDuplicate._id,
         creator: parentForDuplicate._id,
@@ -349,12 +348,13 @@ describe('PageService', () => {
         lastUpdateUser: parentForDuplicate._id,
         lastUpdateUser: parentForDuplicate._id,
         redirectTo: null,
         redirectTo: null,
         revision: parentForDuplicate.revisionId,
         revision: parentForDuplicate.revisionId,
-      });
+      }];
 
 
-      const pageIdMapping = {};
-      pageIdMapping[parentForDuplicate._id] = newPageDummy[0]._id;
+      const pageIdMapping = {
+        [parentForDuplicate._id]: '60110bdd85339d7dc732dddd',
+      };
 
 
-      await crowi.pageService.duplicateTags(pageIdMapping);
+      const duplicateTagsReturn = await crowi.pageService.duplicateTags(pageIdMapping);
       const parentoForDuplicateTags = await PageTagRelation.find({ relatedPage: parentForDuplicate });
       const parentoForDuplicateTags = await PageTagRelation.find({ relatedPage: parentForDuplicate });
       const pageTagRelationAfterDuplicated = await PageTagRelation.find({ relatedPage: newPageDummy });
       const pageTagRelationAfterDuplicated = await PageTagRelation.find({ relatedPage: newPageDummy });