Skip to content

test(scf-core): 12 office/applications tests fail on main — Lane columns render as raw objects #661

Closed

Description

@thinkclay

What

nx run scf-core:test fails on main (63c85be63) with 12 failures out of 1191, across three files in features/office/applications. This is not a flake and not a clock-dependent failure — it reproduces identically on a clean tree.

Found while verifying the dependabot batch (#650). I established a baseline on main specifically to prove the bumps were not the cause: 1191 total / 1121 passed / 12 failed, same test names, before and after. So this is standing red, unrelated to dependencies.

The failures

1. features/office/applications/__tests__/ApplicationsLanes.test.tsx — 10 tests

All ten die at render with the same React error:

Error: Objects are not valid as a React child (found: object with keys {label, value}).
If you meant to render a collection of children, use an array instead.
    at throwOnInvalidObjectTypeImpl (react-dom-client.development.js:6099)
    at reconcileChildFibersImpl (react-dom-client.development.js:7058)

{label, value} is the shape of LaneColumn, the labelled-cell form added to @scaffald/ui's Lane in Scaffald/ui#21 ("stacked rows were a column of orphaned values"). LaneProps.columns is typed Array<ReactNode | LaneColumn> and ApplicationsLanes.tsx:160 passes the labelled form. Under jsdom the object reaches React as a child instead of going through the isLaneColumn branch — so something on the test's render path is not the Lane the types describe.

Failing tests:

  • §12 #7, days in stage — shows days in the current stage, not days since applying
  • §12 #7, days in stage — sorts the stalest row to the top of its stage
  • §12 #8, the reasons to pick one row over another — puts score, source, union status and assignment on the row
  • §12 #8, the reasons to pick one row over another — says Unassigned rather than leaving the cell blank
  • §12 #9, empty states — shows rows instead of the empty state once a stage has any
  • §12 #17, withdrawn is not rejected — distinguishes the two inside the shared Closed lane
  • §12 #17, withdrawn is not rejected — never marks a terminal row overdue however old it is
  • overdue signalling — names what is late rather than only flagging that something is
  • overdue signalling — stays quiet inside the promise
  • selection — reports the row that was pressed

2. features/office/applications/components/__tests__/ApplicationsFilters.test.tsx — 1 test

resets filters when Clear Filters pressed:

TestingLibraryElementError: Unable to find an accessible element with the role "button"
and name `/clear filters/i`

The rendered tree has only combobox/option roles (three data-testid="responsive-select" elements). The button either does not render under the test's conditions or carries no accessible name on web — which is the same class of problem as #638 (accessibilityState is a no-op on web).

3. features/office/applications/hooks/__tests__/useApplicationStatusChange.test.ts — 1 test

executes valid non-critical transitions immediately:

TypeError: queryClient.getQueriesData is not a function
    at patchCachedStatus (hooks/useApplicationStatusChange.ts:129:31)
    at Object.changeStatus (hooks/useApplicationStatusChange.ts:247:24)

The test's queryClient double predates patchCachedStatus reaching for getQueriesData. Straightforwardly a stale test double, independent of the other two.

Reproduce

nx reset && nx run scf-core:test

scf-core:test writes to tests/reports/coverage/test-results.json rather than stdout, so read the failures from there:

node -e "const r=require('./tests/reports/coverage/test-results.json');console.log(r.numPassedTests,'/',r.numTotalTests)"

Note packages/ui must be built first (cd packages/ui && tsup) — its dist/ is gitignored, and a stale one produces a different, misleading failure (Module '@scaffald/ui' has no exported member 'ListToolbar' at typecheck).

Acceptance criteria

  • nx run scf-core:test reports 1191/1191.
  • The ApplicationsLanes render path is fixed at the cause, not by reverting the callers to bare ReactNode columns — the labelled form is what makes a stacked row readable (fix(Lane): stacked rows were a column of orphaned values ui#21).
  • ApplicationsFilters's Clear Filters control is reachable by role and name on web.
  • The useApplicationStatusChange test double covers the queryClient surface the hook actually uses.

Context

Related to #622 (SCF prototype parity — these are the screen primitives that landed in that epic) and #638 (web accessibility roles). The suite is excluded from aggregate commands per packages/scf-core/vitest.config.ts:17, which is part of why this went unnoticed.

Activity

  1. added 2 commits that reference this issue on Aug 27, 2026
  2. thinkclay commented on Sep 1, 2026

    @thinkclay
    ContributorAuthor

    Fixed in #674.

    Lane's columns is ReactNode[] again — the ReactNode | { label, value } union is gone, and the label is composed by the caller (ApplicationsLanes, in a small cell() helper that also decides what a narrow row drops). A render path is the wrong place to be guessing what a value is, whatever the specific reason the guard evaluated differently under vitest than in the app.

    Four explanations were checked and eliminated first — stale dist, a global mock, isValidElement as the fragile clause, a stale Vite cache — and bisecting reached Lane alone with a single labelled column. Scaffald/ui#27 has the detail, and Lane.columns.test.tsx keeps the union from coming back.

    Behaviour verified unchanged against the running app at both widths:

    mobile   Score 0 / Source Scaffald / Assignee Unassigned
    desktop  Score 0 / Source Scaffald / Union — / Assignee Unassigned / Outcome —
    

    scf-core is now 1148/1148 with --skip-nx-cache. The other three failures that were red alongside these turned out to be unrelated and are fixed in #676 — including one that was not a stale test at all, but #675.

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

    ATSFrontendbugpriority: medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions