|
|
@@ -197,9 +197,7 @@ describe('PageService page operations with only public pages', () => {
|
|
|
|
|
|
});
|
|
|
|
|
|
-
|
|
|
const renamePage = async(page, newPagePath, user, options) => {
|
|
|
-
|
|
|
// mock return value
|
|
|
const mockedResumableRenameDescendants = jest.spyOn(crowi.pageService, 'resumableRenameDescendants').mockReturnValue(null);
|
|
|
const mockedCreateAndSendNotifications = jest.spyOn(crowi.pageService, 'createAndSendNotifications').mockReturnValue(null);
|
|
|
@@ -207,9 +205,11 @@ describe('PageService page operations with only public pages', () => {
|
|
|
|
|
|
// retrieve the arguments passed when calling method resumableRenameDescendants inside renamePage method
|
|
|
const argsForCreateAndSendNotifications = mockedResumableRenameDescendants.mock.calls[0];
|
|
|
+
|
|
|
// restores the original implementation
|
|
|
mockedResumableRenameDescendants.mockRestore();
|
|
|
mockedCreateAndSendNotifications.mockRestore();
|
|
|
+
|
|
|
// rename descendants
|
|
|
await crowi.pageService.resumableRenameDescendants(...argsForCreateAndSendNotifications);
|
|
|
|