mirror of
https://github.com/ThisIsBenny/wishlist-app.git
synced 2025-04-19 15:27:41 +00:00
test fixed
Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
parent
59cde55f0f
commit
b026132c32
2 changed files with 3 additions and 3 deletions
|
@ -1,12 +1,12 @@
|
|||
import { describe, assert, it, expect } from 'vitest'
|
||||
import { nextTick } from 'vue'
|
||||
import { mount } from '@vue/test-utils'
|
||||
import { shallowMount } from '@vue/test-utils'
|
||||
import ModalComponent from '../../components/Modal.vue'
|
||||
import { useModal } from '../index'
|
||||
|
||||
describe('composable: useModal', () => {
|
||||
const modal = useModal()
|
||||
const wrapper = mount(ModalComponent, {
|
||||
const wrapper = shallowMount(ModalComponent, {
|
||||
global: {
|
||||
renderStubDefaultSlot: true,
|
||||
},
|
||||
|
|
|
@ -5,7 +5,6 @@ import CreateWishlistView from '@/views/CreateWishlistView.vue'
|
|||
import AddWishlistItemView from '@/views/AddWishlistItemView.vue'
|
||||
import DetailView from '@/views/DetailView.vue'
|
||||
import { useAuth } from '@/composables'
|
||||
const { isAuthenticated } = useAuth()
|
||||
|
||||
const router = createRouter({
|
||||
history: createWebHistory(import.meta.env.BASE_URL),
|
||||
|
@ -50,6 +49,7 @@ const router = createRouter({
|
|||
})
|
||||
|
||||
router.beforeEach((to) => {
|
||||
const { isAuthenticated } = useAuth()
|
||||
if (!isAuthenticated.value && to.meta.requiresAuth === true) {
|
||||
return { name: 'login' }
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue