feat: migrate Toolbar with teleport-safe focus ownership
This commit is contained in:
@@ -530,3 +530,40 @@ it("keeps standalone ToggleButton DOM ids stable on the server", async () => {
|
||||
);
|
||||
expect(html).toContain('id="like-toggle"');
|
||||
});
|
||||
|
||||
it("renders Toolbar with nested groups without browser globals", async () => {
|
||||
const {
|
||||
Toolbar,
|
||||
Button,
|
||||
ButtonGroup,
|
||||
Separator,
|
||||
ToggleButton,
|
||||
ToggleButtonGroup,
|
||||
} = await import("../packages/vue/src");
|
||||
const html = await renderToString(
|
||||
createSSRApp({
|
||||
render: () =>
|
||||
h(
|
||||
Toolbar,
|
||||
{
|
||||
"aria-label": "文本格式",
|
||||
orientation: "vertical",
|
||||
isAttached: true,
|
||||
},
|
||||
() => [
|
||||
h(ToggleButtonGroup, { selectionMode: "multiple" }, () => [
|
||||
h(ToggleButton, { id: "bold" }, () => "Bold"),
|
||||
]),
|
||||
h(Separator),
|
||||
h(ButtonGroup, () => h(Button, () => "Copy")),
|
||||
],
|
||||
),
|
||||
}),
|
||||
);
|
||||
expect(html).toContain('role="toolbar"');
|
||||
expect(html).toContain('aria-orientation="vertical"');
|
||||
expect(html).toContain("hv-toolbar--attached");
|
||||
expect(html).toContain('data-slot="toggle-button-group"');
|
||||
expect(html).toContain("hv-separator--horizontal");
|
||||
expect(html).toContain('data-slot="button-group"');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user