Round dashboards: one face at a time, a face per widget type, paged by swipe, dots and keys; slider reading; face row in the editor
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
8b8cb5cda9
commit
84071ee106
@@ -8,7 +8,8 @@ import { api, apiPage, deleteAll } from "./utils/api"
|
||||
* A knob is turned in bursts, and a lamp or a thermostat fed a value per
|
||||
* detent stutters through every one of them. So the ring moves at once and
|
||||
* sends the value it came to rest on, once — which is what two wheel notches
|
||||
* in quick succession must come to.
|
||||
* in quick succession must come to. And a round dashboard is one face at a
|
||||
* time, paged through without touching the ring.
|
||||
*/
|
||||
const flowName = `test_ring_${Date.now().toString(36)}`
|
||||
const dashboard = `${flowName}_d`
|
||||
@@ -48,11 +49,9 @@ test.beforeAll(async ({ browser }) => {
|
||||
name: dashboard,
|
||||
title: "Ring",
|
||||
version: 0,
|
||||
columns: 4,
|
||||
canvas_width: 360,
|
||||
canvas_height: 360,
|
||||
shape: "round",
|
||||
ring: "level",
|
||||
widgets: [
|
||||
{
|
||||
id: "level",
|
||||
@@ -60,6 +59,12 @@ test.beforeAll(async ({ browser }) => {
|
||||
title: "Level",
|
||||
config: { target, dtype: "float", min: 0, max: 10, step: 0.5 },
|
||||
},
|
||||
{
|
||||
id: "note",
|
||||
type: "markdown",
|
||||
title: "Note",
|
||||
config: { content: "The second face" },
|
||||
},
|
||||
],
|
||||
},
|
||||
})
|
||||
@@ -96,9 +101,13 @@ test("two wheel notches publish once, two steps on", async ({ page }) => {
|
||||
await page.mouse.wheel(0, -100)
|
||||
await page.mouse.wheel(0, -100)
|
||||
// The value moves at once; the publish waits for the turn to settle.
|
||||
await expect(page.getByTestId("ring-centre")).toHaveText("1.0")
|
||||
await expect(page.getByTestId("face-centre")).toHaveText("1.0")
|
||||
await expect.poll(() => sent, { timeout: 5000 }).toEqual([1])
|
||||
// Settled: nothing follows the one publish.
|
||||
await page.waitForTimeout(1000)
|
||||
expect(sent).toEqual([1])
|
||||
|
||||
// Paging is not the ring's arrows: the next face, the ring untouched.
|
||||
await page.keyboard.press("PageDown")
|
||||
await expect(page.getByText("The second face")).toBeVisible()
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user