-
Notifications
You must be signed in to change notification settings - Fork 101
Open
Labels
Description
Environment
- Operating System:
Darwin
- Node Version:
v20.16.0
- Nuxt Version:
3.14.1592
- CLI Version:
3.15.0
- Nitro Version:
2.10.4
- Package Manager:
[email protected]
- Builder:
-
- User Config:
default
- Runtime Modules:
@vueuse/[email protected]
,@unocss/[email protected]
,@nuxt/[email protected]
,@nuxtjs/[email protected]
,@nuxtjs/[email protected]
,@nuxt/test-utils/[email protected]
- Build Modules:
-
Reproduction
Link to the repo: https://github.com/Archetipo95/movies/pull/2
FILES:
NavBar.vue File
<template>
<div
flex="~ row lg:col"
justify-evenly items-center
py5 lg:px5
border="t lg:r base"
bg-black
>
<NuxtLink v-slot="{ isActive }" to="/" :title="$t('Home')" data-testid="home-link">
<div
text-2xl
:class="isActive ? 'i-ph-house-fill text-primary' : 'i-ph-house'"
/>
</NuxtLink>
<NuxtLink v-slot="{ isActive }" to="/movie" :title="$t('Movies')" data-testid="movies-link">
<div
text-2xl
:class="isActive ? 'i-ph-film-strip-fill text-primary' : 'i-ph-film-strip'"
/>
</NuxtLink>
<NuxtLink v-slot="{ isActive }" to="/tv" :title="$t('TV Shows')" data-testid="tv-shows-link">
<div
text-2xl
:class="isActive ? 'i-ph-television-simple-fill text-primary' : 'i-ph-television-simple'"
/>
</NuxtLink>
<NuxtLink v-slot="{ isActive }" to="/search" :title="$t('Search')" data-testid="search-link">
<div
text-2xl
:class="isActive ? 'i-ph-magnifying-glass-fill text-primary' : 'i-ph-magnifying-glass'"
/>
</NuxtLink>
</div>
</template>
NavBar.nuxt.test.ts File
import type { VueWrapper } from '@vue/test-utils'
import { mountSuspended } from '@nuxt/test-utils/runtime'
import { describe, expect, it } from 'vitest'
import NavBar from './NavBar.vue'
describe('navBar', () => {
it('renders Home link correctly', async () => {
const wrapper = await mountSuspended(NavBar)
// test true to be true
expect(true).toBe(true)
})
Describe the bug
Im trying to to a simple component test and I think it's failing to mock NuxtLink with slots when it is destruturing the property isActive
Additional context
No response
Logs
https://github.com/Archetipo95/movies/actions/runs/12358331784/job/34488575188?pr=2