Ver Fonte

add test

yohei0125 há 4 anos atrás
pai
commit
edfb045eb5
1 ficheiros alterados com 5 adições e 1 exclusões
  1. 5 1
      packages/app/test/integration/service/v5.page.test.ts

+ 5 - 1
packages/app/test/integration/service/v5.page.test.ts

@@ -207,6 +207,10 @@ describe('Test page service methods', () => {
       expect(page3.parent).toStrictEqual(page2._id);
       expect(page4.parent).toStrictEqual(page3._id);
     });
-    test('it should fail when PageOperation is not found', async() => {});
+    test('it should fail and throw error if PageOperation is not Found', async() => {
+      const pageOpId = new mongoose.Types.ObjectId(); // not exist in DB
+      await expect(restartPageRenameOperation(pageOpId))
+        .rejects.toThrow(new Error('PageRenameOperation is not executable'));
+    });
   });
 });