ray-template/__test__/workspace/consumer.spec.tsx
XiaoDaiGua-Ray 403fdd589a feat!: rebuild Ray Template as a monorepo
Share workspace packages between Ray Admin and the interactive docs.

BREAKING CHANGE: v6 is a new major line. v5 stays on legacy/v5.
2026-11-04 14:01:28 +08:00

41 lines
1.0 KiB
TypeScript

import { AdminShell } from '@ray-template/admin-shell'
import { RIcon } from '@ray-template/ui/icon'
import { RTablePro } from '@ray-template/ui/table-pro'
import { mount } from '@vue/test-utils'
it('mounts the shared shell, icons and table using only public package entries', async () => {
const wrapper = mount(AdminShell, {
props: {
layout: {
mode: 'right',
contentWidth: 'fluid',
contentMaxWidth: 1200,
contentPadding: 16,
fixedHeader: true,
fixedFooter: true,
},
},
slots: {
sidebar: () => <RIcon name="action/search" />,
default: () => (
<RTablePro
bare
columns={[{ key: 'name', title: 'Name' }]}
data={[{ id: 1, name: 'Workspace consumer' }]}
/>
),
},
})
try {
await vi.waitFor(() => {
expect(
wrapper.get('.r-icon svg').element.childElementCount,
).toBeGreaterThan(0)
})
expect(wrapper.text()).toContain('Workspace consumer')
} finally {
wrapper.unmount()
}
})