aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs/boot/routes.spec.js
diff options
context:
space:
mode:
authorshpuld <shp@cock.li>2018-12-18 22:09:27 +0200
committershpuld <shp@cock.li>2018-12-18 22:09:27 +0200
commit640a28789222035f8d500b8dd4bfc4c9f0cdd1af (patch)
treede6e7a72f0a90b8196b1bf99ac0fe4cd5bfe39a2 /test/unit/specs/boot/routes.spec.js
parentbd2ed617a740ef3b37dedf3bed608e433dc0ec09 (diff)
parent2f28bf95fdce6a215961fe264c236c111e4a1e66 (diff)
Merge branch 'develop' into feature/replace-panel-switcher
Diffstat (limited to 'test/unit/specs/boot/routes.spec.js')
-rw-r--r--test/unit/specs/boot/routes.spec.js29
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..9963555f
--- /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('/~/main/all')
+
+ const matchedComponents = router.getMatchedComponents()
+
+ expect(matchedComponents[0].components.hasOwnProperty('Timeline')).to.eql(true)
+ })
+
+ it('user\'s profile', () => {
+ router.push('/fake-user-name')
+
+ const matchedComponents = router.getMatchedComponents()
+
+ expect(matchedComponents[0].components.hasOwnProperty('UserCardContent')).to.eql(true)
+ })
+})