chore: remove legacy SSR checks and consolidate migration maintenance

This commit is contained in:
maoyingjie
2026-10-26 10:32:22 +08:00
parent 52a0bef851
commit 60af6ee40b
169 changed files with 958 additions and 8422 deletions
-39
View File
@@ -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");