- LiveEdge: a value inside a running pulse restarts the animation by hand, since the class is already on and would show nothing. - Dock, FlowDock: the bar is centred on left-1/2, where a shrink-wrapped box gets only the half of the screen to the right and wrapped into a 195px pill. w-max with the viewport cap keeps one row whenever the buttons fit. The dashboard editor's dock had the same squeeze. - FlowEditor: arriving on an input drawn on the canvas centres its label and opens the label popover once the view is fit, as clicking it does. An input the canvas does not draw still opens the flow settings. - Tests: the phone dock may not be confined to half the screen; the search spec reads the popover first and reaches the settings through its pencil. Claude-Session: https://claude.ai/code/session_01SSi5AvZ7pFmySK8zy3NPMh
74 lines
2.5 KiB
TypeScript
74 lines
2.5 KiB
TypeScript
import { expect, test } from "@playwright/test"
|
|
import { api, apiPage, deleteAll } from "./utils/api"
|
|
|
|
/**
|
|
* The global search: the only way to reach a node without knowing its flow.
|
|
*
|
|
* The load-bearing part is what the flat index turns back into — a node hit is
|
|
* a flow address with that node in focus, which no list endpoint could have
|
|
* answered.
|
|
*/
|
|
|
|
const flowName = `test_search_${Date.now().toString(36)}`
|
|
|
|
test.use({ storageState: "playwright/.auth/user.json" })
|
|
test.describe.configure({ mode: "serial" })
|
|
|
|
test.beforeAll(async ({ browser }) => {
|
|
const page = await apiPage(browser)
|
|
await api(page, `/flows/${flowName}`, {
|
|
method: "PUT",
|
|
data: {
|
|
name: flowName,
|
|
title: "Searchable flow",
|
|
nodes: [{ id: "findme", type: "python", title: "Find me" }],
|
|
inputs: [{ spec: { name: "findme_input", dtype: "float" } }],
|
|
},
|
|
})
|
|
await page.close()
|
|
})
|
|
|
|
test.afterAll(async ({ browser }) => {
|
|
await deleteAll(browser, [`/flows/${flowName}`])
|
|
})
|
|
|
|
test("finds a node by name and opens its flow on it", async ({ page }) => {
|
|
await page.goto("/")
|
|
await page.getByRole("button", { name: "Search", exact: true }).click()
|
|
|
|
await page.getByTestId("global-search-input").fill("findme")
|
|
await page.getByRole("option", { name: /Find me/ }).click()
|
|
|
|
await expect(page).toHaveURL(new RegExp(`/flows/${flowName}\\?node=findme$`))
|
|
})
|
|
|
|
test("finds a flow input and reads it where its label sits", async ({
|
|
page,
|
|
}) => {
|
|
await page.goto("/")
|
|
await page.getByRole("button", { name: "Search", exact: true }).click()
|
|
|
|
await page.getByTestId("global-search-input").fill("findme_input")
|
|
await page.getByRole("option", { name: /findme_input/ }).click()
|
|
|
|
await expect(page).toHaveURL(
|
|
new RegExp(`/flows/${flowName}\\?node=input%3A${flowName}\\.findme_input$`),
|
|
)
|
|
// What clicking the label shows, and the settings one press on.
|
|
await expect(page.getByTestId("input-inspector")).toBeVisible()
|
|
await expect(page.getByTestId("flow-panel")).toBeHidden()
|
|
await page.getByTestId("edit-input").click()
|
|
await expect(page.getByTestId("flow-panel")).toBeVisible()
|
|
})
|
|
|
|
test("opens on the keyboard from anywhere", async ({ page }) => {
|
|
await page.goto("/dashboards")
|
|
// The binding lives in the sidebar, so wait for it to be there to press at.
|
|
await expect(
|
|
page.getByRole("button", { name: "Search", exact: true }),
|
|
).toBeVisible()
|
|
await page.keyboard.press("ControlOrMeta+k")
|
|
|
|
await expect(page.getByTestId("global-search-input")).toBeFocused()
|
|
})
|