test fixed

Signed-off-by: Benny Samir Hierl <bennysamir@posteo.de>
This commit is contained in:
Benny Samir Hierl 2022-02-20 13:08:32 +01:00
parent 59cde55f0f
commit b026132c32
2 changed files with 3 additions and 3 deletions

View file

@ -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,
},

View file

@ -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' }
}