Skip to content

test(workspace): Add integration tests for the workspace shell and step view - #24

Open
SCcagg5 wants to merge 11 commits into
stack/23-ui19from
stack/24-ui20
Open

SCcagg5 wants to merge 11 commits into
stack/23-ui19from
stack/24-ui20

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 24/31. Base branch: stack/23-ui19. Review and merge in order; this PR builds on the previous one.
Size: 29 files changed, 15808 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 29 test files for the workspace code of PR 23. It changes no production code. The tests cover the shell, the bar, the dock, the step run view, the commands and the keys.

Why

PR 23 lands a large amount of new UI at once. The tests are in a separate PR so that review of PR 23 stays on the code. They pass on top of PR 23. PR 25 reworks the surrounding pages and adds more tests, and PR 26 tests the editor side.

Changes

29 files, all new, all tests. No existing file is modified. No production file is touched.

Groups of tests:

  • Shell: WorkflowWorkspace.test.tsx, WorkflowWorkspace.keys.test.tsx, selection.test.tsx (which step or run is selected), layout/WorkspaceLayout.test.tsx, hosts/WorkspaceRunHosts.test.tsx.
  • Behaviour of the single tab: singleTab.parity.test.tsx checks that the run history loads on demand, that the timeline draws one bar per run, and the trigger of a run.
  • Bar: WorkflowBar, RunChip, RunDetailsPopover, RunSplitButton.
  • Dock: DockContext, LogsDock, RunStepsNav, RunTimeline, useDockAutoOpen, dock/tabs/dockTabBodies, and renderCost.test.tsx, which counts renders to keep the dock cheap.
  • Step run view: StepRunView (and an accessibility test), StepFacts, StepManualActions, StepRunTabs, StepSubRuns, useStepRunActions.
  • Commands, keys and notices: WorkflowCommands, useWorkspaceKeys, useWorkspaceNotices, useStepCommandHost, useOpenStepDetails.

How to review

  1. WorkflowWorkspace.test.tsx for the test setup that the others reuse.
  2. dock/__tests__/DockContext.test.tsx and useDockAutoOpen.test.tsx.
  3. step/__tests__/StepRunView.test.tsx and useStepRunActions.test.tsx.
  4. renderCost.test.tsx.

Most attention: tests that assert render counts or exact text may break on harmless changes. Check that they test behaviour.

Tests

All files listed above run with pnpm test in ui/. Each file sits next to the module it checks, in a __tests__ folder.

Screenshots

No visible UI change in this PR. The behaviour it tests is visible in the workspace page that PR 23 adds, for example the Activity panel and the step view.

This was referenced Oct 28, 2026
@yohamta0
yohamta0 force-pushed the stack/23-ui19 branch 2 times, most recently from 7f1089c to 2e9eeaa Compare October 30, 2026 06:44
@yohamta0
yohamta0 force-pushed the stack/24-ui20 branch 2 times, most recently from 388aceb to f6538d0 Compare October 30, 2026 08:43
@yohamta0
yohamta0 force-pushed the stack/24-ui20 branch 3 times, most recently from 72ff7b4 to f2b5b0d Compare October 31, 2026 04:50
@yohamta0
yohamta0 force-pushed the stack/24-ui20 branch 2 times, most recently from 765d09b to f142e71 Compare October 31, 2026 06:28
@yohamta0
yohamta0 force-pushed the stack/23-ui19 branch 2 times, most recently from 0d357a0 to f52574e Compare October 31, 2026 10:44
SCcagg5 and others added 11 commits October 31, 2026 19:45
…gucloud#3403)

* UI: dags/components, workflow-workspace/dock, workflow-workspace/step
* Expect runs to open on the workflow page in E2E
* Open run links of DAGs named apart from files
* Expect a sub-run link to drop its step
* Give sub-runs an address and show file-less runs
* Test the summary link of a waiting agent
* Read step reuse from the run record in step facts
* Fix draft step runs, foreach items and run links
The workflow page now shows runs: an old ?dagRunId link and a progress
card open the run there, and its run bar stops the run. The run page
stays until a later change retires it.
A run is selected in the URL after its start resolves, so checking
the URL right after the start call or the followed run raced the
navigation and failed now and then in CI.
Two fixes of an earlier PR change behavior of the run bar parts that
this PR adds tests for:

- Under ?def=run the canvas shows the run definition, so the stale dot
  of the run chip names no count of steps missing from the canvas.
- When the history does not hold the source run of reused inputs, the
  details take the case of its ID from the record of the reused
  inputs instead of the lower-case label, so "Show run" selects it.

useElementWidth now reads the border box of the element on each
resize, not the content rect of the observer entry. The run timeline
resize test changed only the entry, so it now changes the measured box
too.
Several tests passed whatever the code did:

- The test-run notice was checked against a mock that kept calls from
  earlier tests. The mock is now cleared before each test.
- The failed-start test swallowed the error in the canvas stub. The
  stub now records it, and the test checks the message.
- The test of a failed editor run checked the followed runs before the
  start resolved. It now waits for the start.
- keepTab was only tested where it falls back to the log tab. A test
  now keeps the agent tab of a waiting step.
- A run seen while ?step is set was not checked after the link is
  cleared. The test now clears it and checks that the panel stays shut.
- The click on the disabled test-run toggle checked nothing. The test
  now checks that the callback is not called.

The render cost of the timeline was measured by counting barTone
calls, so memoizing that helper failed the test with no change in
behavior. The test now counts the renders of each bar and extent.

The step navigation tests now find rows by role and read the selection
from aria-current. Tests that render twice call cleanup() instead of
clearing the body, which left the first React root mounted.
A run URL now opens a sub-run with ?subRun, so the new-tab and run
page tests of sub-runs expect it in the URL.

New tests cover:
- A ?subRun link opens the sub-run on the stack with its ?step and
  leaves the URL; a link to a sub-run the run lacks is dropped.
- The step sub-run list keeps a child that the sub-run list does not
  have yet, after the others.
- The run outputs stop polling 15 s after the run ended.
The refresh button resets its spinner 500 ms after a refresh with a
timer that nothing cleared. When the button went away first, as at the
end of a workspace test, the timer updated an unmounted component, and
after the test environment closed it threw "window is not defined",
failing the frontend run although every test passed.
The progress bar of the run details names the succeeded steps of the
total. The test file for the popover starts here.
Step facts label a step reused only from the run record, and read no
outputs while a step runs or waits. The test file starts here.
A step run of an unsaved draft takes its previous and upstream steps
from the draft, and a foreach step opens on its log with the item
list. The mocks of the dirty editor gain getDag. The test files
start here.
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