Explorar o código

change findOne to Id

yohei0125 %!s(int64=3) %!d(string=hai) anos
pai
achega
50c7e68526
Modificáronse 1 ficheiros con 4 adicións e 4 borrados
  1. 4 4
      packages/app/test/integration/service/v5.page.test.ts

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

@@ -310,10 +310,10 @@ describe('Test page service methods', () => {
       const path2 = '/POP0/renamePOP1/renamePOP2';
       const path2 = '/POP0/renamePOP1/renamePOP2';
       const path3 = '/POP0/renamePOP1/renamePOP2/renamePOP3';
       const path3 = '/POP0/renamePOP1/renamePOP2/renamePOP3';
       // page
       // page
-      const page0 = await Page.findOne({ path: path0 });
-      const page1 = await Page.findOne({ path: path1 });
-      const page2 = await Page.findOne({ path: path2 });
-      const page3 = await Page.findOne({ path: path3 });
+      const page0 = await Page.findById(_page0._id);
+      const page1 = await Page.findById(_page1._id);
+      const page2 = await Page.findById(_page2._id);
+      const page3 = await Page.findById(_page3._id);
       // page operation
       // page operation
       const pageOperation = await PageOperation.findOne({ _id: _pageOperation._id });
       const pageOperation = await PageOperation.findOne({ _id: _pageOperation._id });
       expect(pageOperation).toBeNull(); // should not exist
       expect(pageOperation).toBeNull(); // should not exist