|
@@ -706,6 +706,7 @@ describe('PageService', () => {
|
|
|
deleteManyPageSpy = jest.spyOn(Page, 'deleteMany').mockImplementation();
|
|
deleteManyPageSpy = jest.spyOn(Page, 'deleteMany').mockImplementation();
|
|
|
removeAllAttachmentsSpy = jest.spyOn(crowi.attachmentService, 'removeAllAttachments').mockImplementation();
|
|
removeAllAttachmentsSpy = jest.spyOn(crowi.attachmentService, 'removeAllAttachments').mockImplementation();
|
|
|
});
|
|
});
|
|
|
|
|
+
|
|
|
test('deleteCompletelyOperation', async() => {
|
|
test('deleteCompletelyOperation', async() => {
|
|
|
await crowi.pageService.deleteCompletelyOperation([parentForDeleteCompletely._id], [parentForDeleteCompletely.path], { });
|
|
await crowi.pageService.deleteCompletelyOperation([parentForDeleteCompletely._id], [parentForDeleteCompletely.path], { });
|
|
|
|
|
|
|
@@ -822,6 +823,8 @@ describe('PageService', () => {
|
|
|
|
|
|
|
|
describe('v5MigrationByPageIds()', () => {
|
|
describe('v5MigrationByPageIds()', () => {
|
|
|
test('should migrate all pages specified by pageIds', async() => {
|
|
test('should migrate all pages specified by pageIds', async() => {
|
|
|
|
|
+ jest.restoreAllMocks();
|
|
|
|
|
+
|
|
|
// initialize pages for test
|
|
// initialize pages for test
|
|
|
const pages = await Page.insertMany([
|
|
const pages = await Page.insertMany([
|
|
|
{
|
|
{
|
|
@@ -863,7 +866,7 @@ describe('PageService', () => {
|
|
|
|
|
|
|
|
const expected = ['/private1', '/dummyParent', '/dummyParent/private1', '/dummyParent/private1/private2', '/dummyParent/private1/private3'];
|
|
const expected = ['/private1', '/dummyParent', '/dummyParent/private1', '/dummyParent/private1/private2', '/dummyParent/private1/private3'];
|
|
|
|
|
|
|
|
- expect(migratedPagePaths).toBe(expected);
|
|
|
|
|
|
|
+ expect(migratedPagePaths.sort()).toStrictEqual(expected.sort());
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
});
|
|
});
|