Round faces: a bar as concentric arcs with a legend in the middle; larger title, gap line and face text; Read-only in the ring's gap; a round dashboard unpadded on a phone; reduced-motion ring assertion

This commit is contained in:
Melvin Strobl
2026-10-14 16:52:46 +02:00
parent bae4b15505
commit c294789d85
9 changed files with 308 additions and 33 deletions
+33
View File
@@ -111,3 +111,36 @@ test("two wheel notches publish once, two steps on", async ({ page }) => {
await page.keyboard.press("PageDown")
await expect(page.getByText("The second face")).toBeVisible()
})
test("with reduced motion a notch moves the handle at once", async ({
page,
}) => {
await page.emulateMedia({ reducedMotion: "reduce" })
await page.goto(`/view/${dashboard}`)
const ring = page.getByRole("slider", { name: "Level" })
await ring.waitFor({ timeout: 20000 })
const box = (await ring.boundingBox())!
await page.mouse.move(box.x + box.width / 2, box.y + box.height / 2)
const before = await ring.getAttribute("aria-valuenow")
await page.mouse.wheel(0, -100)
await expect(ring).not.toHaveAttribute("aria-valuenow", before ?? "")
// Two frames on, where a spring would still be on its way.
const cx = () =>
page.evaluate(
() =>
new Promise<string | null>((done) =>
requestAnimationFrame(() =>
requestAnimationFrame(() =>
done(
document
.querySelector(".dui-ring-handle")
?.getAttribute("cx") ?? null,
),
),
),
),
)
const first = await cx()
await page.waitForTimeout(600)
expect(await cx()).toBe(first)
})