diff options
| author | Maxim Filippov <colixer@gmail.com> | 2018-12-06 04:05:35 +0300 |
|---|---|---|
| committer | Maxim Filippov <colixer@gmail.com> | 2018-12-06 22:09:54 +0300 |
| commit | 6532462b95fbea1a19508fcdfa50df02b083b657 (patch) | |
| tree | 5237e17d132283ccb55883c3ac76be997bac4435 /test/unit/specs/boot | |
| parent | c3c75e07024dc0b0df2d9ddd06fc0ef5d8ff038e (diff) | |
Move old routes to /p, use /nickname for user profiles
Diffstat (limited to 'test/unit/specs/boot')
| -rw-r--r-- | test/unit/specs/boot/routes.spec.js | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/unit/specs/boot/routes.spec.js b/test/unit/specs/boot/routes.spec.js new file mode 100644 index 00000000..9715b53a --- /dev/null +++ b/test/unit/specs/boot/routes.spec.js @@ -0,0 +1,29 @@ +import routes from 'src/boot/routes' +import { createLocalVue } from '@vue/test-utils' +import VueRouter from 'vue-router' + +const localVue = createLocalVue() +localVue.use(VueRouter) + +describe('routes', () => { + const router = new VueRouter({ + mode: 'abstract', + routes: routes({}) + }) + + it('root path', () => { + router.push('/p/main/all') + + const mathcedComponents = router.getMatchedComponents() + + expect(mathcedComponents[0].components.hasOwnProperty('Timeline')) + }) + + it('user\'s profile', () => { + router.push('/fake-user-name') + + const mathcedComponents = router.getMatchedComponents() + + expect(mathcedComponents[0].components.hasOwnProperty('UserProfile')) + }) +}) |
