Skip to content

test(editor): Add integration tests for the editor, inspector and run overlay - #26

Open
SCcagg5 wants to merge 10 commits into
stack/25-ui22from
stack/26-ui23
Open

SCcagg5 wants to merge 10 commits into
stack/25-ui22from
stack/26-ui23

Conversation

@SCcagg5

@SCcagg5 SCcagg5 commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Part of a stack of 31 pull requests that depend on each other. They must be reviewed and merged in order: each PR builds on the previous one and its diff only contains its own changes.

All PRs of the stack
# PR
1 specs: Add spec 083 and the samples store
2 ir: Add run state fields for ephemeral runs and reused outputs
3 runtime: Bound continuous steps and carry outputs of selected steps
4 api: Add step samples, events, availability and selected-step runs
5 test(ui): add YAML fixtures for the document model tests
6 ui(lib): add shared UI kit, status helpers and right-panel shell
7 ui(canvas): add canvas engine core, toolbars and editor helpers
8 ui(i18n): add workspace message catalogs, first batch
9 ui(canvas): add canvas Flow view, step run panel and workflow panel
10 ui(editor): add YAML document model, canvas model and run source logic
11 ui(editor): Add edit session, YAML format and quick fixes, run actions, tab strip
12 ui(editor): Add canvas graph model, Add step panel, issues popover, run bar
13 ui(canvas): Add layered layout, dependency edges, status styles, reference picker
14 ui(canvas): Add export, flow builder, upstream data panel, output capture
15 ui(canvas): Add node cards, launchers, inspector sections, client issues
16 ui(editor): Add visual editor, step inspector and YAML file panel
17 ui(lists): Open runs on the workflow page; add tab and schedule helpers
18 ui(workspace): Add workspace URL state, legacy redirects and run list links
19 ui(workspace): Add workspace data layer, run facts and Workflow panel
20 ui(workspace): Add run start controls, visible runs and reuse source
21 ui(workspace): Add data provider, bar identity, continuous panel and step list
22 ui(logs): Add run actions cluster, cached logs and log popout page
23 ui(workspace): Add Activity dock, step run view and workflow page
24 test(workspace): Add integration tests for the workspace shell and step view
25 ui(pages): Retire classic run pages and open runs on the workflow page
26 test(editor): Add integration tests for the editor, inspector and run overlay
27 test(ui): Add repository-wide guard tests and ESLint boundary rules
28 e2e: Add workspace helpers and fixtures, update existing specs
29 e2e: Add workspace specs, part 1 of 2
30 e2e: Add workspace specs, part 2 of 2
31 examples: Add the workspace demo workflows

Stack 26/31. Base branch: stack/25-ui22. Review and merge in order; this PR builds on the previous one.
Size: 55 files changed, 22420 insertions(+).
Checked: Typecheck (tsc) of the whole UI and the unit tests of this PR (Vitest), on top of the previous PR.

Summary

This PR adds 55 test files for the visual editor, the canvas, the document model, the inspector, the reference panels and the run overlay. It changes no production code. All files are new.

Why

The editor code landed in earlier PRs (5 to 22). These tests are kept in a separate PR so that the code PRs stay small. They pass on top of PR 25. PR 24 has the matching tests for the workspace shell. PR 27 adds the remaining tests and the guard tests.

Changes

55 files, all new, all tests. No existing file is modified.

Groups of tests:

  • Editor: VisualEditor.test.tsx, .addStep, .hosted, .launchers, .layout; contracts.test.ts; hooks useDocModel, useEditSession, useYamlEditorSync.
  • Canvas: VisualCanvas, graph, layout, useCanvasLayout, gestures, ghost, paletteModel, useCanvasKeymap, contextMenu (and its a11y test), KeyHelpDialog, RenameStepPopover, index.test.ts.
  • Document model: parse, patch, stepIndex, structure. These check that YAML edits keep the text around them.
  • Inspector: one file per section (General, Action, Flow, Timing, Outputs, Parameters, Preconditions, ContinueOn, RouteTable, RunEditor, StepYaml), plus actionRules, catalog, catalogSearch, stepSchemaCheck, stepYamlText, withSchema.
  • References: candidates, monacoCompletion, monacoHover, upstreamTree, DeclaredOutputsPanel, UpstreamDataPanel (with a reused-run case).
  • Run overlay: runOverlay, useRunOverlay, StepRunPanel, and workflow-workspace/executions/__tests__/RunSnapshotCanvas.test.tsx.

How to review

  1. VisualEditor.test.tsx for the shared setup.
  2. doc/__tests__/patch.test.ts and structure.test.ts.
  3. canvas/__tests__/VisualCanvas.test.tsx and gestures.test.ts.
  4. inspector/__tests__/StepYaml.test.tsx and RunEditor.test.tsx.

Most attention: the document model tests, since they pin the rule that an edit changes only the lines it must.

Tests

All files run with pnpm test in ui/. Each sits in a __tests__ folder next to its module.

Screenshots

No visible UI change in this PR. The behaviour it tests is visible in the editable graph and the YAML panel of the workflow page.

This was referenced Oct 28, 2026
@yohamta0
yohamta0 force-pushed the stack/25-ui22 branch 2 times, most recently from c13555d to 2de8bcf Compare October 30, 2026 06:44
@yohamta0
yohamta0 force-pushed the stack/26-ui23 branch 3 times, most recently from e67674f to d71c961 Compare October 30, 2026 08:43
@yohamta0
yohamta0 force-pushed the stack/25-ui22 branch 2 times, most recently from a60260d to 5b56b0f Compare October 30, 2026 11:03
@yohamta0
yohamta0 force-pushed the stack/26-ui23 branch 2 times, most recently from 3aa5d62 to 28e69ea Compare October 31, 2026 06:28
@yohamta0
yohamta0 force-pushed the stack/25-ui22 branch 2 times, most recently from 01b3027 to 891d5a6 Compare October 31, 2026 09:21
SCcagg5 and others added 10 commits October 31, 2026 19:45
dagucloud#3405)

* UI: dags/components, pages, visual-editor/inspector
* Cover null-prototype issue maps in tests
* Keep sub-runs and workspaces on old run links
* Test __proto__ fields and IME keys in inspector
* Fix Mermaid retry, run link and Kanban Ctrl-click
* Resolve latest run links and trust the next run
* Test that Show in all workspaces selects them
Several fixes of earlier PRs change behavior that the tests of this PR
pin, or need a test file that only this PR adds.

Updated for the new behavior:

- Explicit step names win over server details matched by position.
  The host rename test now renames in the YAML text, and the run
  snapshot INPUT test uses a spec whose step names match its scope.
- opSetRouteTargets writes a target given by id as the step name that
  the server resolves.
- The launchers test gives the server time zone that the Cron panel
  now reads for its preview.

New regression tests:

- The rename popover ignores Enter and Escape during an IME
  composition.
- A command step that becomes an action loses a classic `command` key.
- continue_on reads the `failed` alias and replaces it with `failure`,
  and its nested keys and each dependency show their issues.
- Alt+Up and Alt+Down cannot move lines across the edge of the step
  scope in the YAML editor.
- The step schema check names an unknown key such as `constructor`.
Several tests passed only because of the order, the time zone, or test
ids that nothing renders:

- Fake timers, the canvas size, the saved spec and the stored canvas
  direction now reset before or after each test, so one failure or a
  reordered run does not change the next test.
- The reused-input tests capture at noon UTC, so the shown date is
  the same in every time zone.
- The launcher test checks the options of the Add step list by name,
  and the layout tests drop checks of a button that no longer exists.
- The diff performance test inserts two separate blocks, so it runs
  the Myers search and not only the prefix and suffix shortcut.
- The builtin action count is a lower bound, so a schema that adds an
  action does not fail the test.
The step schema check warns about an unknown key in the with block
of a run step, and the outputs input adds no entry on the Enter that
confirms an input method's text. Both test fixes from earlier in the
stack, whose test files start here.
While no text has parsed, the editor draws the steps of the server
DAG, frozen, under a banner that names the line of the first error.
Route targets send nothing on an untouched blur and compare edited
lists item by item. The step run panel labels a step reused only from
the run record and reads no outputs while it waits. The cycle check
follows step output references. Their test files start here.
A step added with the + button of an inferred edge now precedes the
target, as its ghost showed. The structure and gesture tests expect
the target to depend on the new step.
Tests for fixes from earlier in the stack whose test files start
here: continue_on keeps an explicit off state, custom action refs
resolve in their schema, layout keeps a step named __proto__, output
variables and named outputs show as separate rows, and the inspector
edits shell, script, outputs and preconditions as the server reads
them.
The test called the drawer's onClose without checking the result, and
outside act. It now closes the drawer inside act and asserts that the
drawer is no longer open, so the close path is covered.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants