Skip to content

test: ten wiring tests name a condition they do not exercise ("bare in the single composition") #2915

Description

@morozsm

Problem

Ten tests in the semantic-wiring suites are named after a claim they do not
test. They assert that a surface renders bare, and attribute that to the
composition:

it('renders it bare in the single composition, outside every zone', ...)

They pass — but not for the stated reason. These are standalone mounts that
resolve no surface plan: useSurfacePlan() falls back to NO_PLAN
(presentation/workspace/resolution.ts), so zoneOwning() returns null for
every surface regardless of what any manifest declares. Under desktop-v2 —
which has declared a zone for all 14 members of SEMANTIC_SURFACE_NAMES since
the rework tail — these same surfaces mount zoned, not bare.

So the name states a property of the composition; the test measures a property
of the fixture. A reader looking for "does the single composition zone this
surface?" is told the wrong answer by the name alone, without opening the file.

This is the test-name half of the comment defect swept in #2914 — that PR
corrected the prose and deliberately left test names alone, since renaming is a
code change.

The house pattern already exists

semantic-tx-aux-wiring.component.test.ts:381 is already named correctly:

it('binds no zone id to the txAux surface in either composition, absent a resolved plan', ...)

and its comment states the rule the others elide: "a zone element must exist
only where BOTH a layout declared one AND a plan actually resolved it."
The
same file pairs it with a positive counterpart at :788 that binds the real zone
under resolveSurfacePlan(desktopV2Layout, ...). That pair is the model.

Sites

frontend/src/components-v2/wiring/__tests__/ — renders it bare in the single composition, outside every zone:

  • semantic-antenna-wiring.component.test.ts:243
  • semantic-band-wiring.component.test.ts:209
  • semantic-cw-keyer-wiring.component.test.ts:653
  • semantic-dsp-wiring.component.test.ts:319
  • semantic-rf-front-end-wiring.component.test.ts:362
  • semantic-ritxit-scan-wiring.component.test.ts:416
  • semantic-rx-audio-wiring.component.test.ts:409
  • semantic-scope-controls-wiring.component.test.ts:296

Same shape, binds no zone id ... in either composition:

  • semantic-meters-wiring.component.test.ts:313
  • semantic-scope-display-wiring.component.test.ts:309

Already correct, do not touch: semantic-tx-aux-wiring.component.test.ts:381.
Out of scope: ScopeDisplaySurface.test.ts:121 and MetersSurface.test.ts:211
are pure-surface tests — "binds no zone id of its own" is a true statement
about the surface, not about a composition.

Acceptance criteria

  1. Each of the ten names states the condition actually exercised — that no
    surface plan is resolved — rather than attributing bareness to the
    composition. Follow semantic-tx-aux-wiring:381's wording.
  2. No assertion body changes. This is a naming fix; if a body needs to change,
    that is a different defect and belongs in its own issue.
  3. Whether each suite also gains a positive counterpart (the surface IS zoned
    under resolveSurfacePlan(desktopV2Layout, ...), as tx-aux:788 does) is a
    judgement call per suite — decide explicitly and record the decision, rather
    than adding ten by reflex. The vocabulary-wide guarantee is already held by
    presentation/layouts/__tests__/zone-ownership-coverage.test.ts.
  4. Full suite green: cd frontend && npx vitest run.

Why it matters

zone-ownership-coverage.test.ts records that the MOR-1317 ledger is empty —
every surface is zone-owned on desktop-v2. Ten test names in the suites that
exercise those very surfaces still say the opposite. The next implementer reads
the name, not the fixture.

Activity

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions