]> git.ipfire.org Git - thirdparty/vuejs/router.git/commitdiff
test(matcher): test alias with children
authorEduardo San Martin Morote <posva13@gmail.com>
Thu, 17 Oct 2019 17:19:52 +0000 (19:19 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Thu, 17 Oct 2019 17:19:52 +0000 (19:19 +0200)
__tests__/matcher.spec.ts

index 0c45d3674bda0255b0c1c744e09560c036be8365..25812de7c143c3f4c8971bd12ad1a0fb700e8010 100644 (file)
@@ -110,6 +110,28 @@ describe('Router Matcher', () => {
           }
         )
       })
+
+      it('resolves an alias with children', () => {
+        const children = [{ path: 'one', component, name: 'nested' }]
+        assertRecordMatch(
+          {
+            path: '/parent',
+            alias: '/p',
+            component,
+            children,
+          },
+          { path: '/p/one' },
+          {
+            path: '/p/one',
+            name: 'nested',
+            params: {},
+            matched: [
+              { path: '/p', children, components },
+              { path: '/p/one', name: 'nested', components },
+            ],
+          }
+        )
+      })
     })
 
     describe('LocationAsPath', () => {