Przeglądaj źródła

add test for retrievePageRedirectChains

Yuki Takei 3 lat temu
rodzic
commit
bade80175e

+ 12 - 0
packages/app/test/integration/models/page-redirect.test.js

@@ -45,6 +45,18 @@ describe('PageRedirect', () => {
   });
   });
 
 
   describe('.retrievePageRedirectChains', () => {
   describe('.retrievePageRedirectChains', () => {
+    test('shoud return null when data is not found', async() => {
+      // setup:
+      expect(await PageRedirect.findOne({ fromPath: '/path1' })).toBeNull();
+
+      // when:
+      // retrieve
+      const chains = await PageRedirect.retrievePageRedirectChains('/path1');
+
+      // then:
+      expect(chains).toBeNull();
+    });
+
     test('shoud return IPageRedirectChains', async() => {
     test('shoud return IPageRedirectChains', async() => {
       // setup:
       // setup:
       await PageRedirect.insertMany([
       await PageRedirect.insertMany([