Frontend addresses flows and dashboards by id: routes /flows/$flowId, /dashboards/$id and /view/$id, query keys, saves, lists, device pickers, search, brain and endpoint links and generated results dashboards go by id, while live values, issues, pauses and message names keep the key; tabs take the title from the document; creating uses POST and opens the issued id; the flow and dashboard panels show key and id with a copy button and a served HTTP or WebSocket node shows its hook URL under the flow id; specs create by POST and ids.spec.ts exercises issued ids
This commit is contained in:
+39
-39
@@ -1,6 +1,12 @@
|
||||
import { expect, test } from "@playwright/test"
|
||||
|
||||
import { api, apiPage, deleteAll } from "./utils/api"
|
||||
import {
|
||||
api,
|
||||
apiPage,
|
||||
createDashboard,
|
||||
createFlow,
|
||||
deleteAll,
|
||||
} from "./utils/api"
|
||||
|
||||
/**
|
||||
* A round dashboard's ring publishes once a turn settles, not per notch.
|
||||
@@ -21,20 +27,17 @@ test.describe.configure({ mode: "serial" })
|
||||
test.beforeAll(async ({ browser }) => {
|
||||
const page = await apiPage(browser)
|
||||
// One node that only declares: a publish lands without waking a run.
|
||||
await api(page, `/flows/${flowName}`, {
|
||||
method: "PUT",
|
||||
data: {
|
||||
name: flowName,
|
||||
title: "Ring",
|
||||
version: 1,
|
||||
nodes: [
|
||||
{
|
||||
id: "emit",
|
||||
type: "python",
|
||||
provides: [{ name: "level", dtype: "float" }],
|
||||
},
|
||||
],
|
||||
},
|
||||
await createFlow(page, {
|
||||
name: flowName,
|
||||
title: "Ring",
|
||||
version: 1,
|
||||
nodes: [
|
||||
{
|
||||
id: "emit",
|
||||
type: "python",
|
||||
provides: [{ name: "level", dtype: "float" }],
|
||||
},
|
||||
],
|
||||
})
|
||||
const flow = await (await api(page, `/flows/${flowName}?draft=true`)).json()
|
||||
await api(page, `/flows/${flowName}/publish`, {
|
||||
@@ -43,30 +46,27 @@ test.beforeAll(async ({ browser }) => {
|
||||
})
|
||||
|
||||
await api(page, `/dashboards/${dashboard}`, { method: "DELETE" })
|
||||
const made = await api(page, `/dashboards/${dashboard}`, {
|
||||
method: "PUT",
|
||||
data: {
|
||||
name: dashboard,
|
||||
title: "Ring",
|
||||
version: 0,
|
||||
canvas_width: 360,
|
||||
canvas_height: 360,
|
||||
shape: "round",
|
||||
widgets: [
|
||||
{
|
||||
id: "level",
|
||||
type: "slider",
|
||||
title: "Level",
|
||||
config: { target, dtype: "float", min: 0, max: 10, step: 0.5 },
|
||||
},
|
||||
{
|
||||
id: "note",
|
||||
type: "markdown",
|
||||
title: "Note",
|
||||
config: { content: "The second face" },
|
||||
},
|
||||
],
|
||||
},
|
||||
const made = await createDashboard(page, {
|
||||
name: dashboard,
|
||||
title: "Ring",
|
||||
version: 0,
|
||||
canvas_width: 360,
|
||||
canvas_height: 360,
|
||||
shape: "round",
|
||||
widgets: [
|
||||
{
|
||||
id: "level",
|
||||
type: "slider",
|
||||
title: "Level",
|
||||
config: { target, dtype: "float", min: 0, max: 10, step: 0.5 },
|
||||
},
|
||||
{
|
||||
id: "note",
|
||||
type: "markdown",
|
||||
title: "Note",
|
||||
config: { content: "The second face" },
|
||||
},
|
||||
],
|
||||
})
|
||||
if (!made.ok())
|
||||
throw new Error(`dashboard PUT ${made.status()}: ${await made.text()}`)
|
||||
|
||||
Reference in New Issue
Block a user