chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
@@ -251,45 +251,6 @@ it("closes only the highest modal and retains the parent lock", async () => {
|
||||
expect(document.body.style.overflow).not.toBe("hidden");
|
||||
});
|
||||
|
||||
it("hydrates open portal content with stable trigger/label associations", async () => {
|
||||
const { createSSRApp } = await import("vue");
|
||||
const { renderToString } = await import("@vue/server-renderer");
|
||||
const view = defineComponent({
|
||||
components,
|
||||
template: `<OverlayDialogRoot default-open><DialogTrigger>open</DialogTrigger><OverlayPortal><OverlayBackdrop/><OverlayDialogContent>${content}</OverlayDialogContent></OverlayPortal></OverlayDialogRoot>`,
|
||||
});
|
||||
const host = document.createElement("div");
|
||||
document.body.append(host);
|
||||
host.innerHTML = await renderToString(createSSRApp(view));
|
||||
expect(host.querySelector("[role=dialog]")).toBeNull();
|
||||
const triggerId = host.querySelector("button")!.getAttribute("aria-controls");
|
||||
const warn = vi.spyOn(console, "warn").mockImplementation(() => {});
|
||||
const error = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
const app = createSSRApp(view);
|
||||
try {
|
||||
app.mount(host);
|
||||
await settle();
|
||||
const dialog = document.querySelector("[role=dialog]")!;
|
||||
expect(dialog.id).toBe(triggerId);
|
||||
expect(
|
||||
document.getElementById(dialog.getAttribute("aria-labelledby")!)
|
||||
?.textContent,
|
||||
).toBe("Title");
|
||||
expect(
|
||||
document.getElementById(dialog.getAttribute("aria-describedby")!)
|
||||
?.textContent,
|
||||
).toBe("Hint");
|
||||
expect(warn).not.toHaveBeenCalled();
|
||||
expect(error).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
app.unmount();
|
||||
await settle();
|
||||
host.remove();
|
||||
warn.mockRestore();
|
||||
error.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("preserves direction and language through teleport with reactive explicit overrides", async () => {
|
||||
const dir = ref<"ltr" | "rtl">("rtl");
|
||||
const locale = ref("ar");
|
||||
|
||||
Reference in New Issue
Block a user