chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { mount } from "@vue/test-utils";
|
||||
import { createSSRApp, defineComponent, h, nextTick, ref } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { defineComponent, h, nextTick, ref } from "vue";
|
||||
import {
|
||||
Checkbox,
|
||||
CheckboxContent,
|
||||
@@ -401,45 +400,6 @@ for (const kind of ["checkbox", "radio"] as const) {
|
||||
expect(new FormData(two).getAll("new")).toEqual(["a"]);
|
||||
w.unmount();
|
||||
});
|
||||
it("renders and hydrates complete SSR associations and default selection", async () => {
|
||||
const view = defineComponent({
|
||||
render: () =>
|
||||
group(kind, {
|
||||
name: "choices",
|
||||
defaultValue: kind === "checkbox" ? ["b"] : "b",
|
||||
isRequired: true,
|
||||
validationBehavior: "aria",
|
||||
}),
|
||||
});
|
||||
const host = document.createElement("div");
|
||||
host.innerHTML = await renderToString(createSSRApp(view));
|
||||
document.body.append(host);
|
||||
const ids = [...host.querySelectorAll("[id]")].map((el) => el.id);
|
||||
for (const el of host.querySelectorAll(
|
||||
"[aria-describedby],[aria-labelledby]",
|
||||
))
|
||||
for (const attr of ["aria-describedby", "aria-labelledby"])
|
||||
for (const id of el.getAttribute(attr)?.split(" ") ?? [])
|
||||
expect(ids).toContain(id);
|
||||
const error = vi.spyOn(console, "error"),
|
||||
warn = vi.spyOn(console, "warn"),
|
||||
app = createSSRApp(view);
|
||||
try {
|
||||
app.mount(host);
|
||||
await tick();
|
||||
expect(error).not.toHaveBeenCalled();
|
||||
expect(warn).not.toHaveBeenCalled();
|
||||
expect(
|
||||
host.querySelectorAll<HTMLInputElement>("input[data-choice-input]")[1]
|
||||
.checked,
|
||||
).toBe(true);
|
||||
} finally {
|
||||
app.unmount();
|
||||
host.remove();
|
||||
error.mockRestore();
|
||||
warn.mockRestore();
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
it("handles radio arrows, RTL, disabled skipping and caller cancellation", async () => {
|
||||
|
||||
Reference in New Issue
Block a user