mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-12-02 17:53:47 +08:00
Add interactive hook examples, shared Pinia runtime state, and configurable layouts. Generate typed namespaced icons during development, HMR, and builds. Refine the UI and establish project comment and design conventions. Validation: typecheck, ESLint, 181 tests, and production build passed.
24 lines
716 B
TypeScript
24 lines
716 B
TypeScript
import { mount } from '@vue/test-utils'
|
|
import GlobalSearch from '../../src/layout/components/Search/GlobalSearch'
|
|
import { router } from '../../src/router'
|
|
import setupMiniApp from '../utils/setupMiniApp'
|
|
|
|
it('mounts the header search on a narrow viewport and closes it immediately', async () => {
|
|
vi.stubGlobal('innerWidth', 390)
|
|
const { app } = await setupMiniApp()
|
|
|
|
try {
|
|
const wrapper = mount(GlobalSearch, {
|
|
props: { show: true },
|
|
global: { plugins: [router] },
|
|
})
|
|
|
|
expect(wrapper.emitted('update:show')).toContainEqual([false])
|
|
expect(wrapper.find('.global-search').exists()).toBe(false)
|
|
wrapper.unmount()
|
|
} finally {
|
|
app.unmount()
|
|
vi.unstubAllGlobals()
|
|
}
|
|
})
|