mirror of
https://github.com/XiaoDaiGua-Ray/ray-template.git
synced 2026-11-29 16:13:41 +08:00
Share workspace packages between Ray Admin and the interactive docs. BREAKING CHANGE: v6 is a new major line. v5 stays on legacy/v5.
24 lines
738 B
TypeScript
24 lines
738 B
TypeScript
import { mount } from '@vue/test-utils'
|
|
import GlobalSearch from '../../apps/admin/src/layout/components/Search/GlobalSearch'
|
|
import { router } from '../../apps/admin/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()
|
|
}
|
|
})
|