aboutsummaryrefslogtreecommitdiff
path: root/test/unit/specs/boot/routes.spec.js
diff options
context:
space:
mode:
authorlambda <pleromagit@rogerbraun.net>2018-12-18 15:26:00 +0000
committerlambda <pleromagit@rogerbraun.net>2018-12-18 15:26:00 +0000
commit2f28bf95fdce6a215961fe264c236c111e4a1e66 (patch)
tree9e91911158deba707b538cbd06b03d51d46344af /test/unit/specs/boot/routes.spec.js
parentc1ff17ebb0a96d715f8badd0061f78420154a498 (diff)
parent63ad08050ef54d2770260989de4b4b7b41c451ef (diff)
Merge branch 'feature/new-user-routes' into 'develop'
Make domain.com/username routes work Closes pleroma#395 See merge request pleroma/pleroma-fe!392
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)
+ })
+})