Skip to content

aggregator(aa): Cost Explorer band lane charts have no behavioural test — only source-string assertions #8600

Closed

Description

@dezren39

Finding

The Cost Explorer band lane charts added by PR #3972 ship with no behavioural test. The only test coverage is source-string matching in pm-stack/aggregator/test/aa.test.ts (:714-725 on current main): the assertions check that the emitted page contains the renderer's source text — expect(html).toContain("function bandLaneChart"), toContain('class="xpl-band-lanes"'), the bandLaneChart("Lowest price within each speed target", "cost", …) call-site text, and toContain("g6Lanes.push"). None of them execute bandLaneChart against data. The assertions would still pass if the function returned "", mis-scaled every point, or plotted nothing — and the a11y suite's only script-level check compiles the explorer script with new Function(source) (a syntax check). The chart's actual logic — axis range computed from all band members while only near-leader choices are plotted, log vs linear scaling, the lo === hi widening, leader detection and point placement — is untested in every direction.

Evidence

Why it matters

The lane charts are the visual half of the band comparisons — the tables' numbers are tested, the chart that re-plots them is not. A scaling or leader-detection regression would ship silently because the string-match tests pin the function's presence, not its behaviour; they also break on harmless refactors (renaming the function) while passing real breakage, the worst combination a test can have.

Acceptance criteria

  • A test executes bandLaneChart (directly, or by evaluating the emitted explorer script in a harness) against known band data and asserts on the rendered output: number of plotted points, leader point identity/styling, and axis behaviour for a log-scale metric.
  • The lo === hi single-value widening case is covered.
  • The members-range vs choices-points relationship is pinned by an assertion (whichever behaviour is intended), so a future change to either set is a deliberate test change.
  • The existing source-string assertions for the lane chart are removed or demoted in favour of the behavioural ones.

agent-note:v1
Agent: pr-diff-review-b
State: filed
Source PR: #3972 (#3972)
Verified against main: 1a06801 (two reads)

Activity

  1. added
    kind/testTest coverage, test infrastructure, or test-only fixes
    task/triageQueue packet kind: verify, reproduce, and route this item
    on Nov 11, 2026
  2. developing-today commented on Nov 11, 2026

    @developing-today
    Contributor
  3. added
    priority/lowNice to have; do when convenient
    effort/sSmall: expected under 2 hours of work
    app/pm-stackpm-stack (Pad/Grist) in developing-today/code
    on Nov 11, 2026
  4. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    Agent: pr-diff-review-b
    State: filed
    Repo: developing-today/code
    Source PR: #3972 (#3972), merged 2cb2055
    Finding: band lane charts have no behavioural test — aa.test.ts:714-725 asserts only that the emitted page contains the renderer's source strings; bandLaneChart is never executed against data in any test (a11y suite only syntax-compiles the script).
    Verified against main: 1a06801 (two reads of aa.test.ts and render.ts)
    Evidence: hidden_files/pr-review-b-2026-11-11-0118/issue-3972-body.md + diff-3972.patch

  5. added
    queue/claimedQueue worker lifecycle state
    and removed on Nov 11, 2026
  6. added a commit that references this issue on Nov 11, 2026
  7. dezren39 commented on Nov 11, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · done — bandLaneChart now has behavioural tests; PR #8654 merged, issue closed

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

    app/pm-stackpm-stack (Pad/Grist) in developing-today/codeeffort/sSmall: expected under 2 hours of workkind/testTest coverage, test infrastructure, or test-only fixespriority/lowNice to have; do when convenientsource/pr-diff-reviewFiled by the pr-diff-review jobstatus:donetask/triageQueue packet kind: verify, reproduce, and route this item

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions