Skip to content

Commit 223d120

Browse files
committed
test: fix test warnings and flakiness
- Add createStackPlugin isolation to Dialog tests to prevent "Ticket already exists" warnings from shared singleton - Remove redundant onboard() call in useDiscovery test - Fix empty app component warning in useFeatures tests - Suppress expected console.warn calls in validation tests (useHotkey, createNested, Avatar renderless, useBreakpoints) - Increase testTimeout to 20s across all vitest configs to prevent intermittent timeouts under parallel load
1 parent b60af77 commit 223d120

File tree

10 files changed

+88
-49
lines changed

10 files changed

+88
-49
lines changed

apps/docs/src/composables/useDiscovery/index.test.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -678,9 +678,6 @@ describe('useDiscovery', () => {
678678
discovery.complete()
679679
expect(discovery.isComplete.value).toBe(true)
680680

681-
// Need to start again since complete() sets isActive to false
682-
discovery.tours.onboard([mockTour as any])
683-
684681
discovery.reset()
685682

686683
expect(discovery.isComplete.value).toBe(false)

apps/docs/vitest.config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,6 @@ export default defineConfig({
2424
environment: 'happy-dom',
2525
globals: true,
2626
include: ['**/*.{test,spec}.?(c|m)[jt]s?(x)'],
27+
testTimeout: 20_000,
2728
},
2829
})

packages/0/src/components/Avatar/index.test.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,10 @@ describe('avatar', () => {
359359

360360
describe('renderless mode', () => {
361361
it('should support renderless mode with slot props', () => {
362+
// Suppress Vue warning about runtime directive on non-element root
363+
// This is expected when using v-show with renderless components
364+
const warnSpy = vi.spyOn(console, 'warn').mockImplementation(() => {})
365+
362366
let slotProps: any
363367

364368
const wrapper = mount(Avatar.Root, {
@@ -375,6 +379,8 @@ describe('avatar', () => {
375379

376380
expect(slotProps).toBeDefined()
377381
expect(wrapper.find('.custom-img').exists()).toBe(true)
382+
383+
warnSpy.mockRestore()
378384
})
379385
})
380386
})

0 commit comments

Comments
 (0)