Shun Miyazawa 4 years ago
parent
commit
7c51ffdde3
1 changed files with 19 additions and 19 deletions
  1. 19 19
      packages/app/src/test/service/page.test.js

+ 19 - 19
packages/app/src/test/service/page.test.js

@@ -240,6 +240,25 @@ describe('PageService', () => {
     xssSpy = jest.spyOn(crowi.xss, 'process').mockImplementation(path => path);
   });
 
+  describe('rename page without using renameDescendantsWithStreamSpy', () => {
+    let pageEventSpy;
+    beforeEach(async() => {
+      pageEventSpy = jest.spyOn(crowi.pageService.pageEvent, 'emit').mockImplementation();
+    });
+
+    describe('renamePage()', () => {
+      test('rename page with different tree with isRecursively', async() => {
+        const resultPage = await crowi.pageService.renamePage(parentForRename6, '/parentForRename6/renamedChild', testUser1, {}, true);
+        const wrongPage = await Page.findOne({ path: '/parentForRename6/renamedChild/renamedChild' });
+        const expectPage = await Page.findOne({ path: '/parentForRename6/renamedChild' });
+
+        expect(resultPage.path).toEqual(expectPage.path);
+        expect(wrongPage).toBeNull();
+      });
+    });
+
+  });
+
   describe('rename page', () => {
     let pageEventSpy;
     let renameDescendantsWithStreamSpy;
@@ -404,25 +423,6 @@ describe('PageService', () => {
     });
   });
 
-  describe('rename page without using renameDescendantsWithStreamSpy', () => {
-    let pageEventSpy;
-    beforeEach(async() => {
-      pageEventSpy = jest.spyOn(crowi.pageService.pageEvent, 'emit').mockImplementation();
-    });
-
-    describe('renamePage()', () => {
-      test('rename page with different tree with isRecursively', async() => {
-        const resultPage = await crowi.pageService.renamePage(parentForRename6, '/parentForRename6/renamedChild', testUser1, {}, true);
-        const wrongPage = await Page.findOne({ path: '/parentForRename6/renamedChild/renamedChild' });
-        const expectPage = await Page.findOne({ path: '/parentForRename6/renamedChild' });
-
-        expect(resultPage.path).toEqual(expectPage.path);
-        expect(wrongPage).toBeNull();
-      });
-    });
-
-  });
-
   describe('duplicate page', () => {
     let duplicateDescendantsWithStreamSpy;