fix tests
This commit is contained in:
parent
080a2b00ba
commit
25d0d16dbb
10 changed files with 203 additions and 204 deletions
|
|
@ -7,16 +7,10 @@ import { createStore } from 'vuex'
|
|||
|
||||
import routes from 'src/boot/routes'
|
||||
|
||||
const store = createStore({
|
||||
state: {
|
||||
instance: {},
|
||||
},
|
||||
})
|
||||
|
||||
describe('routes', () => {
|
||||
const router = createRouter({
|
||||
history: createMemoryHistory(),
|
||||
routes: routes(store),
|
||||
routes: routes(),
|
||||
})
|
||||
|
||||
it('root path', async () => {
|
||||
|
|
@ -24,12 +18,9 @@ describe('routes', () => {
|
|||
|
||||
const matchedComponents = router.currentRoute.value.matched
|
||||
|
||||
expect(
|
||||
Object.hasOwn(
|
||||
matchedComponents[0].components.default.components,
|
||||
'Timeline',
|
||||
),
|
||||
).to.eql(true)
|
||||
expect(matchedComponents[0].components.default.__file).to.contain(
|
||||
'/timeline.vue',
|
||||
)
|
||||
})
|
||||
|
||||
it("user's profile", async () => {
|
||||
|
|
@ -38,7 +29,7 @@ describe('routes', () => {
|
|||
const matchedComponents = router.currentRoute.value.matched
|
||||
|
||||
expect(matchedComponents[0].components.default.__file).to.contain(
|
||||
'user_profile.vue',
|
||||
'/user_profile.vue',
|
||||
)
|
||||
})
|
||||
|
||||
|
|
@ -48,7 +39,7 @@ describe('routes', () => {
|
|||
const matchedComponents = router.currentRoute.value.matched
|
||||
|
||||
expect(matchedComponents[0].components.default.__file).to.contain(
|
||||
'user_profile.vue',
|
||||
'/user_profile.vue',
|
||||
)
|
||||
})
|
||||
|
||||
|
|
@ -57,7 +48,7 @@ describe('routes', () => {
|
|||
|
||||
const matchedComponents = router.currentRoute.value.matched
|
||||
expect(matchedComponents[0].components.default.__file).to.contain(
|
||||
'lists.vue',
|
||||
'/lists.vue',
|
||||
)
|
||||
})
|
||||
|
||||
|
|
@ -67,7 +58,7 @@ describe('routes', () => {
|
|||
const matchedComponents = router.currentRoute.value.matched
|
||||
|
||||
expect(matchedComponents[0].components.default.__file).to.contain(
|
||||
'lists_timeline.vue',
|
||||
'/timeline.vue',
|
||||
)
|
||||
})
|
||||
|
||||
|
|
@ -77,7 +68,7 @@ describe('routes', () => {
|
|||
const matchedComponents = router.currentRoute.value.matched
|
||||
|
||||
expect(matchedComponents[0].components.default.__file).to.contain(
|
||||
'lists_edit.vue',
|
||||
'/lists_edit.vue',
|
||||
)
|
||||
})
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue