]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test: matcher nested record
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 6 May 2019 16:18:22 +0000 (18:18 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 6 May 2019 16:19:21 +0000 (18:19 +0200)
__tests__/matcher.spec.js

index 6907b15eb7f9b9a1907d6f308858659e426ad08f..97f1f111efa5c0c4db61c072efd79d2a209cd998 100644 (file)
@@ -604,6 +604,37 @@ describe('Router Matcher', () => {
           }
         )
       })
+
+      it('resolves nested children with params with named location', () => {
+        const Foo = {
+          path: '/foo',
+          name: 'Foo',
+          component,
+          children: [NestedWithParam],
+        }
+        assertRecordMatch(
+          Foo,
+          { name: 'nested-child-params', params: { p: 'a', n: 'b' } },
+          {
+            name: 'nested-child-params',
+            path: '/foo/nested/b/a',
+            params: { p: 'a', n: 'b' },
+            matched: [
+              Foo,
+              {
+                ...NestedWithParam,
+                path: `${Foo.path}/${NestedWithParam.path}`,
+              },
+              {
+                ...NestedChildWithParam,
+                path: `${Foo.path}/${NestedWithParam.path}/${
+                  NestedChildWithParam.path
+                }`,
+              },
+            ],
+          }
+        )
+      })
     })
   })
 })