test: audit Slider foundation and document adapter requirements

This commit is contained in:
maoyingjie
2026-10-23 11:59:39 +08:00
parent 23527d4e4c
commit b1cb00deba
7 changed files with 266 additions and 2 deletions
+17
View File
@@ -0,0 +1,17 @@
// @vitest-environment node
import { expect, it } from "vitest";
import { createSSRApp, h } from "vue";
import { renderToString } from "@vue/server-renderer";
import Foundation from "../packages/vue/tests/fixtures/SliderFoundation.vue";
it("records that raw collection thumbs have no value or stable position on the server", async () => {
expect(typeof window).toBe("undefined");
const html = await renderToString(
createSSRApp({
render: () => h(Foundation, { defaultValue: [20, 80] }),
}),
);
expect(html.match(/role="slider"/g)).toHaveLength(2);
expect(html).not.toContain("aria-valuenow=");
expect(html).toContain("display:none");
});