chore: remove legacy SSR checks and consolidate migration maintenance
This commit is contained in:
+1
-45
@@ -1,7 +1,6 @@
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
import { mount, flushPromises } from "@vue/test-utils";
|
||||
import { createSSRApp, defineComponent, h, ref } from "vue";
|
||||
import { renderToString } from "@vue/server-renderer";
|
||||
import { defineComponent, h, ref } from "vue";
|
||||
import {
|
||||
ListBox,
|
||||
ListBoxItem,
|
||||
@@ -392,49 +391,6 @@ describe("ListBox public behavior", () => {
|
||||
expect(wrapper.text()).toContain("No results");
|
||||
});
|
||||
|
||||
it("hydrates selected options and label relationships without mismatches", async () => {
|
||||
const Component = defineComponent({
|
||||
render: () =>
|
||||
h(ListBox, { defaultValue: [0] }, () =>
|
||||
h(
|
||||
ListBoxItem,
|
||||
{ id: 0 },
|
||||
{
|
||||
default: () => [
|
||||
h(Label, {}, () => "Bob"),
|
||||
h(Description, {}, () => "Details"),
|
||||
],
|
||||
},
|
||||
),
|
||||
),
|
||||
});
|
||||
const host = document.createElement("div");
|
||||
host.innerHTML = await renderToString(createSSRApp(Component));
|
||||
document.body.append(host);
|
||||
const before = host.querySelector('[role="option"]')!;
|
||||
const beforeId = before.id;
|
||||
const warnings: string[] = [];
|
||||
const app = createSSRApp(Component);
|
||||
app.config.warnHandler = (message) => warnings.push(message);
|
||||
app.mount(host);
|
||||
await flushPromises();
|
||||
try {
|
||||
expect(warnings).toEqual([]);
|
||||
const after = host.querySelector('[role="option"]')!;
|
||||
expect(after).toBe(before);
|
||||
expect(after.id).toBe(beforeId);
|
||||
expect(after.getAttribute("aria-selected")).toBe("true");
|
||||
expect(after.getAttribute("aria-labelledby")).toBe(
|
||||
after.querySelector('[data-slot="label"]')?.id,
|
||||
);
|
||||
expect(after.getAttribute("aria-describedby")).toBe(
|
||||
after.querySelector('[data-slot="description"]')?.id,
|
||||
);
|
||||
} finally {
|
||||
app.unmount();
|
||||
}
|
||||
});
|
||||
|
||||
it("compiles and mounts all nine baseline demos together without warnings or duplicate IDs", async () => {
|
||||
const demos = import.meta.glob("../apps/docs/demos/list-box-*.vue", {
|
||||
eager: true,
|
||||
|
||||
Reference in New Issue
Block a user