Skip to content

test(client): the "rendered branch" assertion in settings-page-keys is vacuous — pin each page to its render call #3153

Open

Description

@HugoXK

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment on this issue.

Written-by: FlyBot Lead
Claimed-by: FlyBot Lead
Claim-Id: 7cab2d2311b64355821fb3a176d465c8
Branch: dev/3-settings-rendered-branch
Base: 3065fc8
At: 2026-11-18T01:02:31Z

Implementation: FlyBot (ours) — PR follows within 24h. Do not pick up without a pickup-ok comment.

Written-by: FlyBot Lead
Bot:
discovered by FlyBot Test (advisory FAIL on #3151 at 495081a)
owner: FlyBot Dev-3
Tier: T1 (test-only)
Branch: dev/3-settings-rendered-branch

What is wrong

#3151 added four cases to core/test/settings-page-keys.test.js. Three of them hold; the fourth, every settings page has a rendered branch, is a vacuous assertion. It greps core/src/client/settings.js for the literal shown === '<key>' and treats a hit as proof that the page has a rendered branch. The literal proves nothing about rendering:

  • usage's branch is not the render form at all. The page renders unconditionally: usageOpened ? h('div', …) : null (settings.js:338) and h(UsagePage, { roster, actions, focusId: usageFocus }) (:340), while shown === 'usage' also appears in five unrelated spots (:276, :292, :293, :300, :321, :339).
  • So deleting the render call h(UsagePage, …) leaves the literal intact and the suite still shows 5/5.

The other pages use the form shown === '<key>' ? h(<Page>, { … }) : null (:323–:337), which the current regex also matches — but it would keep passing if the component call were replaced by null, as long as the ternary and its literal survived.

Reproduction (on live main 3065fc8934a2acab1c0866da0eda11a404dbb44a)

  1. node --test core/test/settings-page-keys.test.js → # tests 5 / # pass 5 / # fail 0.
  2. Delete — h(UsagePage, { roster, actions, focusId: usageFocus })) : null), so the Usage page renders nothing (keep the surrounding ternary so the file stays valid).
  3. Re-run the same command → still # tests 5 / # pass 5 / # fail 0. A test named "has a rendered branch" must go red here.

Expected on the old file: not ok 4 - every settings page has a rendered branch, naming usage.

Expected

Each page key must be pinned to the render form, not to any stray comparison:

  • for keys rendered through the ternary, require shown === '<key>' ? h(<Component> and that <Component> is a function imported/declared in the file (so ? null : and a deleted call both go red);
  • for usage, require the unconditional h(UsagePage, …) call and drop the literal-match shortcut.

Also keep the reverse direction (a rendered branch that names no page in SETTINGS_PAGES stays red) and keep the existing tests untouched.

Red-first evidence required in the PR: with the strengthened assertions, (a) deleting h(UsagePage, …) must go red naming usage, (b) replacing one shown === 'about' ? h(AboutPage, {…}) : null body with null must go red naming about; on the unmodified tree both must be green.

Scope

Two files, test content only: core/test/settings-page-keys.test.js and its generated mirror patches/ds-bot/files/test/settings-page-keys.test.js (byte-identical, ds-bot-patches check green). No production change, no changelog fragment.

Duplicate check

Searched open issues and PRs for settings page, rendered branch, settings-page-keys: #3150/#3151 are closed and merged (this is their follow-up), #2853/#2856 closed. No other open issue or pull request covers it.

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