feat: add Typography EmptyState and Breadcrumbs

This commit is contained in:
maoyingjie
2026-10-22 13:07:13 +08:00
parent bcadbeaf8c
commit e4d817ce55
50 changed files with 3130 additions and 90 deletions
+40
View File
@@ -194,3 +194,43 @@ it("renders choice groups and nested content associations without browser global
expect(refs.length).toBeGreaterThan(2);
for (const id of refs) expect(ids).toContain(id);
});
it("renders typography, empty state and breadcrumbs without browser globals", async () => {
const {
Typography,
TypographyHeading,
TypographyParagraph,
TypographyCode,
TypographyProse,
EmptyState,
Breadcrumbs,
BreadcrumbsItem,
} = await import("../packages/vue/src");
const html = await renderToString(
createSSRApp({
render: () =>
h("div", {}, [
h(Typography, { type: "h2" }, () => "排版标题"),
h(TypographyHeading, { level: 3 }, () => "三级标题"),
h(TypographyParagraph, { size: "sm" }, () => "正文"),
h(TypographyCode, {}, () => "code"),
h(TypographyProse, {}, () => h("p", "富文本段落")),
h(EmptyState),
h(Breadcrumbs, {}, () => [
h(BreadcrumbsItem, { href: "#home" }, () => "首页"),
h(BreadcrumbsItem, null, () => "当前页"),
]),
]),
}),
);
expect(html).toContain("<h2");
expect(html).toContain("hv-typography--h2");
expect(html).toContain('data-type="h3"');
expect(html).toContain("No results found");
expect(html).toContain('aria-label="Breadcrumbs"');
expect(html).toContain('aria-current="page"');
expect(html).toContain('data-current="true"');
expect(html).toContain("hv-breadcrumbs__separator");
expect(html).toContain("富文本段落");
});