Explorar o código

update test case

Yuki Takei %!s(int64=3) %!d(string=hai) anos
pai
achega
6ff10fd459
Modificáronse 1 ficheiros con 8 adicións e 9 borrados
  1. 8 9
      packages/app/test/integration/models/page-redirect.test.js

+ 8 - 9
packages/app/test/integration/models/page-redirect.test.js

@@ -21,26 +21,25 @@ describe('PageRedirect', () => {
         { fromPath: '/org/path1', toPath: '/path1' },
         { fromPath: '/org/path2', toPath: '/path2' },
         { fromPath: '/org/path3', toPath: '/path3' },
-        { fromPath: '/org/path33', toPath: '/path3' },
+        { fromPath: '/org/path33', toPath: '/org/path333' },
+        { fromPath: '/org/path333', toPath: '/path3' },
       ]);
       expect(await PageRedirect.findOne({ fromPath: '/org/path1' })).not.toBeNull();
       expect(await PageRedirect.findOne({ fromPath: '/org/path2' })).not.toBeNull();
       expect(await PageRedirect.findOne({ fromPath: '/org/path3' })).not.toBeNull();
       expect(await PageRedirect.findOne({ fromPath: '/org/path33' })).not.toBeNull();
+      expect(await PageRedirect.findOne({ fromPath: '/org/path333' })).not.toBeNull();
 
       // when:
       // remove all documents that have { toPath: '/path/3' }
       await PageRedirect.removePageRedirectByToPath('/path3');
 
       // then:
-      const r1 = await PageRedirect.findOne({ fromPath: '/org/path1' });
-      const r2 = await PageRedirect.findOne({ fromPath: '/org/path2' });
-      const r3 = await PageRedirect.findOne({ fromPath: '/org/path3' });
-      const r4 = await PageRedirect.findOne({ fromPath: '/org/path33' });
-      expect(r1).not.toBeNull();
-      expect(r2).not.toBeNull();
-      expect(r3).toBeNull();
-      expect(r4).toBeNull();
+      expect(await PageRedirect.findOne({ fromPath: '/org/path1' })).not.toBeNull();
+      expect(await PageRedirect.findOne({ fromPath: '/org/path2' })).not.toBeNull();
+      expect(await PageRedirect.findOne({ fromPath: '/org/path3' })).toBeNull();
+      expect(await PageRedirect.findOne({ fromPath: '/org/path33' })).toBeNull();
+      expect(await PageRedirect.findOne({ fromPath: '/org/path333' })).toBeNull();
     });
   });