feat: migrate ScrollShadow and Tabs with docs and keyboard support
This commit is contained in:
@@ -432,3 +432,30 @@ it("renders public Modal Popover and Tooltip roots without browser globals", asy
|
||||
expect(html).not.toContain('role="dialog"');
|
||||
expect(html).not.toContain('role="tooltip"');
|
||||
});
|
||||
|
||||
it("renders ScrollShadow and Tabs without browser globals and resolves initial panel IDs", async () => {
|
||||
const { ScrollShadow, Tabs, TabsList, TabsTab, TabsPanel, TabsIndicator } =
|
||||
await import("../packages/vue/src");
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(Tabs, {}, () => [
|
||||
h(TabsList, { "aria-label": "SSR tabs" }, () => [
|
||||
h(TabsTab, { value: "a" }, () => ["A", h(TabsIndicator)]),
|
||||
h(TabsTab, { value: "b" }, () => ["B", h(TabsIndicator)]),
|
||||
]),
|
||||
h(TabsPanel, { value: "a" }, () =>
|
||||
h(ScrollShadow, { visibility: "bottom" }, () => "SSR content"),
|
||||
),
|
||||
h(TabsPanel, { value: "b" }, () => "not selected"),
|
||||
]),
|
||||
}),
|
||||
);
|
||||
expect(html).toContain('aria-selected="true"');
|
||||
expect(html).toContain('data-bottom-scroll="true"');
|
||||
expect(html).toContain("SSR content");
|
||||
expect(html).not.toContain("not selected");
|
||||
const controls = html.match(/aria-controls="([^"]+)"/)?.[1];
|
||||
expect(controls).toBeTruthy();
|
||||
expect(html).toContain(`id="${controls}"`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user