Skip to content

Commit 63493f8

Browse files
howwohmmclaude
andcommitted
fix(test): use static import and add missing type field
Switch from dynamic `await import('#components')` to static top-level import to match the pattern used by HeaderConnectorModal.spec.ts. Add required `type: 'link'` to NavigationLink test data. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 87dad03 commit 63493f8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/nuxt/components/Header/MobileMenu.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { describe, it, expect, vi } from 'vitest'
22
import { mockNuxtImport, mountSuspended } from '@nuxt/test-utils/runtime'
33
import { computed, nextTick } from 'vue'
4+
import { HeaderMobileMenu } from '#components'
45

56
// Mock useConnector
67
mockNuxtImport('useConnector', () => () => ({
@@ -24,7 +25,6 @@ vi.mock('@vueuse/integrations/useFocusTrap', () => ({
2425

2526
describe('MobileMenu', () => {
2627
async function mountMenu(open = false) {
27-
const { HeaderMobileMenu } = await import('#components')
2828
return mountSuspended(HeaderMobileMenu, {
2929
props: {
3030
open,
@@ -33,7 +33,7 @@ describe('MobileMenu', () => {
3333
type: 'group' as const,
3434
name: 'main',
3535
label: 'Navigation',
36-
items: [{ name: 'home', label: 'Home', to: '/', iconClass: 'i-lucide:home' }],
36+
items: [{ type: 'link' as const, name: 'home', label: 'Home', to: '/', iconClass: 'i-lucide:home' }],
3737
},
3838
],
3939
},

0 commit comments

Comments
 (0)