test(web): provide favicon environment in desktop boot fixture
This commit is contained in:
1 parent
6b9c01996f
commit
f2a22a3108
1 file changed
+7
-1
@@ -1,5 +1,5 @@
|
||||
// @vitest-environment jsdom
|
||||
import { afterEach, expect, it, vi } from 'vitest'
|
||||
import { afterEach, beforeEach, expect, it, vi } from 'vitest'
|
||||
|
||||
const boot = vi.hoisted(() => ({
|
||||
run: vi.fn(),
|
||||
@@ -10,10 +10,16 @@ vi.mock('@deepseek-ai/dsh-client-web', () => ({
|
||||
applyIndexInjections: boot.applyIndexInjections,
|
||||
}))
|
||||
|
||||
beforeEach(() => {
|
||||
document.head.innerHTML = '<link rel="icon" type="image/svg+xml" href="/favicon.svg">'
|
||||
vi.stubGlobal('matchMedia', () => ({ matches: false, addEventListener: vi.fn() }))
|
||||
})
|
||||
|
||||
afterEach(() => {
|
||||
vi.unstubAllGlobals()
|
||||
vi.clearAllMocks()
|
||||
vi.resetModules()
|
||||
document.head.replaceChildren()
|
||||
document.body.replaceChildren()
|
||||
})
|
||||
|
||||
|
||||
Reference in new issue
Block a user