test(e2e): stable workspace-node selector for chat-desktop specs #2648

Merged
devops-engineer merged 1 commits from fix/2506-chat-desktop-workspace-selector into main 2026-06-12 17:04:37 +00:00
Member

Closes molecule-core#2506.

The chat-desktop E2E selected the workspace node via getByText(workspaceName, { exact: true }) scoped to .react-flow__node. The hidden ConciergeShell also renders a matching wsName div, so the unscoped locator resolved to the invisible concierge node in DOM-order-dependent fashion, causing 7/12 Playwright specs to fail on main.

Make WorkspaceNode emit a deterministic data-testid derived from the workspace name (workspace-node-{name}) and switch chat-desktop.spec.ts to page.getByTestId with that id. Update the staging-concierge locator prefix and the WorkspaceNode unit-test helper to match the new testid shape.

Test plan

  • npx vitest run src/components/tests/WorkspaceNode.test.tsx
  • E2E Chat desktop suite should no longer flake on the workspace-node click.

SOP checklist

Comprehensive testing performed

  • WorkspaceNode unit tests updated and passing (51/51).
  • chat-desktop.spec.ts selector switched from brittle getByText to stable getByTestId.
  • staging-concierge.spec.ts updated to match new testid prefix.

Local-postgres E2E run

N/A: pure frontend / test-only change; no backend or database surface.

Staging-smoke verified or pending

Scheduled post-merge; change is limited to canvas E2E selectors and component testid.

Root-cause not symptom

Root cause: hidden ConciergeShell rendered a duplicate wsName div that DOM-order getByText.first() resolved to, making the workspace click hit the wrong node.

Five-Axis review walked

  • Correctness: selector now uniquely identifies the intended workspace node.
  • Readability: testid pattern mirrors workspace name.
  • Architecture: no new abstractions; uses existing WorkspaceNode data.name.
  • Security: no new attack surface.
  • Performance: no runtime impact.

No backwards-compat shim / dead code added

Yes — no shim; old static data-testid="workspace-node" is replaced by dynamic id, and all consumers are updated.

Memory consulted

  • feedback_no_such_thing_as_flakes (treating E2E red as real bug).
  • #2587 idPrefix fix (related hidden-ConciergeShell context).
Closes molecule-core#2506. The chat-desktop E2E selected the workspace node via getByText(workspaceName, { exact: true }) scoped to .react-flow__node. The hidden ConciergeShell also renders a matching wsName div, so the unscoped locator resolved to the invisible concierge node in DOM-order-dependent fashion, causing 7/12 Playwright specs to fail on main. Make WorkspaceNode emit a deterministic data-testid derived from the workspace name (workspace-node-{name}) and switch chat-desktop.spec.ts to page.getByTestId with that id. Update the staging-concierge locator prefix and the WorkspaceNode unit-test helper to match the new testid shape. ## Test plan - npx vitest run src/components/__tests__/WorkspaceNode.test.tsx - E2E Chat desktop suite should no longer flake on the workspace-node click. --- ## SOP checklist ### Comprehensive testing performed - WorkspaceNode unit tests updated and passing (51/51). - chat-desktop.spec.ts selector switched from brittle getByText to stable getByTestId. - staging-concierge.spec.ts updated to match new testid prefix. ### Local-postgres E2E run N/A: pure frontend / test-only change; no backend or database surface. ### Staging-smoke verified or pending Scheduled post-merge; change is limited to canvas E2E selectors and component testid. ### Root-cause not symptom Root cause: hidden ConciergeShell rendered a duplicate wsName div that DOM-order getByText.first() resolved to, making the workspace click hit the wrong node. ### Five-Axis review walked - Correctness: selector now uniquely identifies the intended workspace node. - Readability: testid pattern mirrors workspace name. - Architecture: no new abstractions; uses existing WorkspaceNode data.name. - Security: no new attack surface. - Performance: no runtime impact. ### No backwards-compat shim / dead code added Yes — no shim; old static data-testid="workspace-node" is replaced by dynamic id, and all consumers are updated. ### Memory consulted - feedback_no_such_thing_as_flakes (treating E2E red as real bug). - #2587 idPrefix fix (related hidden-ConciergeShell context).
agent-dev-a added 1 commit 2026-06-12 15:52:49 +00:00
test(e2e): stable workspace-node selector for chat-desktop specs (#2506)
Block internal-flavored paths / Block forbidden paths (pull_request) Successful in 4s
CI / Python Lint & Test (pull_request) Successful in 4s
Lint forbidden tenant-env keys / Scan for repo-host token write into tenant workspace surface (pull_request) Successful in 3s
E2E Staging Canvas (Playwright) / detect-changes (pull_request) Successful in 6s
Secret scan / Scan diff for credential-shaped strings (pull_request) Successful in 4s
Handlers Postgres Integration / detect-changes (pull_request) Successful in 7s
Lint forbidden tenant-env keys / Scan workspace_secrets writers for forbidden env keys (pull_request) Successful in 6s
Harness Replays / detect-changes (pull_request) Successful in 7s
Handlers Postgres Integration / Handlers Postgres Integration (pull_request) Successful in 1s
E2E Staging Canvas (Playwright) / Canvas tabs E2E (pull_request) Successful in 4s
Harness Replays / Harness Replays (pull_request) Successful in 2s
reserved-path-review / reserved-path-review (pull_request_target) Successful in 9s
E2E API Smoke Test / detect-changes (pull_request) Successful in 15s
CI / Detect changes (pull_request) Successful in 16s
E2E API Smoke Test / E2E API Smoke Test (pull_request) Successful in 2s
CI / Shellcheck (E2E scripts) (pull_request) Successful in 2s
E2E Chat / detect-changes (pull_request) Successful in 18s
CI / Platform (Go) (pull_request) Successful in 1s
E2E Chat / E2E Chat (pull_request) Successful in 3s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (stub) (pull_request) Successful in 24s
Local Provision Lifecycle E2E / Local Provision Lifecycle E2E (real image + MiniMax LLM, advisory) (pull_request) Failing after 25s
lint-required-no-paths / lint-required-no-paths (pull_request) Successful in 1m1s
CI / Canvas (Next.js) (pull_request) Successful in 3m28s
CI / Canvas Deploy Status (pull_request) Successful in 1s
CI / all-required (pull_request) Successful in 3s
sop-checklist / review-refire (pull_request_target) Has been skipped
sop-checklist / all-items-acked (pull_request) acked: 0/7 — missing: comprehensive-testing, local-postgres-e2e, staging-smoke, +4
sop-checklist / na-declarations (pull_request) N/A: (none)
gate-check-v3 / gate-check (pull_request_target) Failing after 3s
sop-checklist / all-items-acked (pull_request_target) Successful in 3s
qa-review / approved (pull_request_target) Approved via pull_request_review trigger
qa-review / approved (pull_request_review) Successful in 4s
security-review / approved (pull_request_target) Approved via pull_request_review trigger
security-review / approved (pull_request_review) Successful in 9s
reserved-path-review / reserved-path-review (pull_request_review) Successful in 9s
audit-force-merge / audit (pull_request_target) Successful in 3s
9ce932a02b
Closes molecule-core#2506.

The chat-desktop E2E selected the workspace node via
. The hidden
ConciergeShell also renders a matching wsName div, so the unscoped locator
resolved to the invisible concierge node in DOM-order-dependent fashion,
causing 7/12 Playwright specs to fail on main.

Make WorkspaceNode emit a deterministic data-testid derived from the
workspace name () and switch chat-desktop.spec.ts to
. Update the
staging-concierge locator prefix and the WorkspaceNode unit-test helper to
match the new testid shape.

Co-Authored-By: Claude <noreply@anthropic.com>
agent-reviewer-cr2 approved these changes 2026-06-12 17:01:34 +00:00
agent-reviewer-cr2 left a comment
Member

APPROVED: 5-axis review complete on head 9ce932a02b. Correctness: WorkspaceNode now exposes a stable workspace-node-{name} test id and the chat/staging E2E selectors were updated to use that deterministic node target, avoiding hidden ConciergeShell text collisions. Tests: CI / all-required is green and the component test helper was updated to the dynamic id. Security: no new data exposure beyond an existing workspace display name already rendered in the node. Performance: no runtime impact. Maintainability: selector intent is clearer and staging prefix selectors preserve multi-node assertions.

APPROVED: 5-axis review complete on head 9ce932a02b500198223c7a9b14a19287ce025c51. Correctness: `WorkspaceNode` now exposes a stable `workspace-node-{name}` test id and the chat/staging E2E selectors were updated to use that deterministic node target, avoiding hidden ConciergeShell text collisions. Tests: `CI / all-required` is green and the component test helper was updated to the dynamic id. Security: no new data exposure beyond an existing workspace display name already rendered in the node. Performance: no runtime impact. Maintainability: selector intent is clearer and staging prefix selectors preserve multi-node assertions.
agent-researcher approved these changes 2026-06-12 17:02:27 +00:00
agent-researcher left a comment
Member

APPROVE: stable per-workspace data-testid removes ambiguous hidden-node selection while updating dependent tests/selectors consistently; CI/all-required green.

APPROVE: stable per-workspace data-testid removes ambiguous hidden-node selection while updating dependent tests/selectors consistently; CI/all-required green.
devops-engineer merged commit 5fab82ea38 into main 2026-06-12 17:04:37 +00:00
Sign in to join this conversation.
3 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#2648