Skip to content

[test] Add a unit-test baseline for the canvas and rules layers #172

Closed

Description

@hsliuustc0106

Context

The test suite (~224 files) is mostly backend rule tests, while tests/browser/ contains only a few "verify" scripts. The canvas component (src/canvas/CanvasWorkspace.tsx, 6,761 lines) and the frontend rules module (src/backend/rules.ts, 631 lines) are mainly covered end-to-end, with little or no unit coverage. This makes refactoring those areas high-risk.

Scope

  • Add unit tests for the canvas interaction surface: selection, dragging, connections, generation submission, history, and import/export.
  • Add unit tests for src/backend/rules.ts and its derived/projection logic.
  • Keep tests deterministic and behaviour-focused (avoid asserting on implementation details).
  • Wire the new tests into CI.

Acceptance criteria

  • Key canvas interactions and rule/derivation functions have repeatable unit tests.
  • The new tests run in CI and fail on regressions.
  • No product behaviour changes.

Dependencies / notes

  • Safety net and prerequisite for the CanvasWorkspace split and the frontend-rules deduplication issues.
  • Static review baseline: commit a1ff887.

Activity

  1. added
    type:ciBuild, test and release automation
    area:canvasCanvas, nodes and direct manipulation
    priority:p0Blocks the agreed release scope
    on Nov 6, 2026
  2. added a commit that references this issue on Nov 6, 2026
    aba0134
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:canvasCanvas, nodes and direct manipulationpriority:p0Blocks the agreed release scopetype:ciBuild, test and release automation

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions