From 6532462b95fbea1a19508fcdfa50df02b083b657 Mon Sep 17 00:00:00 2001 From: Maxim Filippov Date: Thu, 6 Dec 2018 04:05:35 +0300 Subject: Move old routes to /p, use /nickname for user profiles --- test/unit/specs/boot/routes.spec.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 test/unit/specs/boot/routes.spec.js (limited to 'test/unit') 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')) + }) +}) -- cgit v1.2.3-70-g09d2