chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
@@ -222,58 +222,6 @@ it("bridges explicit PopoverDialog labels and forwards dynamic attrs to actual s
|
||||
).toBe(false);
|
||||
});
|
||||
|
||||
it("hydrates public roots then resolves all portal ARIA references without duplicate IDs", async () => {
|
||||
const { createSSRApp } = await import("vue");
|
||||
const { renderToString } = await import("@vue/server-renderer");
|
||||
const { Modal, ModalBackdrop, ModalContainer, ModalDialog, ModalHeading } =
|
||||
await import("../packages/vue/src");
|
||||
const appView = defineComponent({
|
||||
components: {
|
||||
...components,
|
||||
Modal,
|
||||
ModalBackdrop,
|
||||
ModalContainer,
|
||||
ModalDialog,
|
||||
ModalHeading,
|
||||
},
|
||||
template: `<div><Modal default-open><Button>Modal</Button><ModalBackdrop><ModalContainer><ModalDialog><ModalHeading>Modal Heading</ModalHeading></ModalDialog></ModalContainer></ModalBackdrop></Modal><Popover default-open><Button>Popover</Button>${content}</Popover><Tooltip default-open><Button>Tooltip</Button><TooltipContent>Hint</TooltipContent></Tooltip></div>`,
|
||||
});
|
||||
const host = document.createElement("div");
|
||||
document.body.append(host);
|
||||
host.innerHTML = await renderToString(createSSRApp(appView));
|
||||
const warnings = vi.spyOn(console, "warn").mockImplementation(() => {}),
|
||||
errors = vi.spyOn(console, "error").mockImplementation(() => {});
|
||||
const app = createSSRApp(appView);
|
||||
try {
|
||||
app.mount(host);
|
||||
await flushPromises();
|
||||
const ids = Array.from(document.querySelectorAll("[id]")).map(
|
||||
(el) => el.id,
|
||||
);
|
||||
expect(new Set(ids).size).toBe(ids.length);
|
||||
for (const el of document.querySelectorAll(
|
||||
"[aria-controls],[aria-labelledby],[aria-describedby]",
|
||||
))
|
||||
for (const name of [
|
||||
"aria-controls",
|
||||
"aria-labelledby",
|
||||
"aria-describedby",
|
||||
])
|
||||
for (const id of (el.getAttribute(name) || "")
|
||||
.split(" ")
|
||||
.filter(Boolean))
|
||||
expect(document.getElementById(id), id).not.toBeNull();
|
||||
expect(warnings).not.toHaveBeenCalled();
|
||||
expect(errors).not.toHaveBeenCalled();
|
||||
} finally {
|
||||
app.unmount();
|
||||
await flushPromises();
|
||||
host.remove();
|
||||
warnings.mockRestore();
|
||||
errors.mockRestore();
|
||||
}
|
||||
});
|
||||
|
||||
it("cancels a pending hover close when the parent closes and reopens the controlled tooltip", async () => {
|
||||
vi.useFakeTimers({ toFake: ["setTimeout", "clearTimeout"] });
|
||||
const open = ref(false);
|
||||
|
||||
Reference in New Issue
Block a user