fix(docs): use native header control composition and default sizing

This commit is contained in:
maoyingjie
2026-10-24 07:39:22 +08:00
parent 2ce80b17da
commit 77acdb276e
7 changed files with 73 additions and 36 deletions
+21
View File
@@ -112,6 +112,27 @@ it("keeps component navigation usable when a themed thumbnail fails", async () =
expect(w.get('a[href="/components/button"]').text()).toBe("Button 按钮");
expect(w.findAll("img.component-thumbnail-dark")).toHaveLength(5);
});
it("uses a native version trigger, button-styled source anchor and detached theme controls", async () => {
host.route.path = "/components/button";
const w = fixture(Layout as never, { global: { stubs: { Content: true } } });
const version = w.get('[aria-label="版本信息"]');
expect(version.element.tagName).toBe("BUTTON");
const source = w.get('[aria-label="项目源码"]');
expect(source.element.tagName).toBe("A");
expect(source.attributes("href")).toBe(
"https://git.myjdemo.cn/maoyingjie/heroui-vue",
);
expect(source.classes()).toContain("hv-button--tertiary");
expect(w.get(".docs-theme-wide").classes()).toContain(
"hv-toggle-button-group--detached",
);
await version.trigger("click");
await flushPromises();
expect(document.querySelector(".version-panel")?.textContent).toContain(
"社区独立实现",
);
});
describe("documentation structure", () => {
it("makes every existing component page reachable exactly once in navigation and its category overview", () => {
const pages = readdirSync("apps/docs/components")