Skip to content

test: repair 7 failing test-all.sh files, fix ROLE_COLORS under a CB preset (#174 part B) - #178

Merged
dborup merged 7 commits into
masterfrom
codex/issue-174-part-b
Oct 3, 2026
Merged

dborup merged 7 commits into
masterfrom
codex/issue-174-part-b

Conversation

@dborup

@dborup dborup commented Oct 2, 2026

Copy link
Copy Markdown
Owner

Summary

Part B of #174: repairs the seven failing test-all.sh files that are not covered by part A, one commit per file (1438 and 1446 together). Every failure had the same shape: a production change was intentional and the test was never updated, because none of these files runs in CI.

One of the failures was not a stale test. It exposed a real regression in public/roles.js (see "Real regression found").

Relates to #174

Per file

File Cause Choice Coverage / what the test guards now
test-frontend-helpers.js favStar() moved from the ★/☆ glyphs to a Phosphor sprite <svg> in Kpa-clawbot#1648 M2; the two assertions still grepped for the glyphs. The tbody.contains is not a function log (13 times) was a missing contains() on the nodes WS sandbox element; renderRows() has called it since Kpa-clawbot#1616. The log did not fail the run. (a) update expectation + add stub #ph-star-fill / #ph-star, the on class and aria-pressed
test-channel-psk-ux.js channels.js uses ph-lock-open / ph-lock instead of 🔓/🔒 since Kpa-clawbot#1648 M2 (a) update expectation asserts the badgeIcon mapping: user-added → ph-lock-open, encrypted → ph-lock
test-analytics-channels-integration.js the "Channel Analytics" chip was dropped on purpose by the chat-app redesign (Kpa-clawbot#1376) (a) invert the assertion source guard that #/analytics / .ch-analytics-link stay out of channels.js; the rendered header is covered by test-issue-1367-channels-chat-app-e2e.js
test-issue-1648-m3-emoji-scan.js the ping bot (2026-07-23) added 🏓 pong! (reply text) and a 🤖 avatar to channels.js after the M3 sweep (a) narrow allowlist, 2 exact substrings any other emoji in channels.js still fails. The 🤖 avatar is real iconography and is only exempted because the sprite has no robot symbol; TODO in the test to add ph-robot and drop the entry
test-issue-1438-customizer-mcrole.js since Kpa-clawbot#1449, applyCSS removes the documentElement --mc-role-* write while a preset is active, so the preset colour only comes from body[data-cb-preset] in style.css. The test read the root inline style (now empty). (a) model the cascade effective value = body inline > body[data-cb-preset] rule parsed from style.css > root inline; server colour must still stay out of the root write
test-issue-1446-cb-preset-cascade.js same cause (scenario 5 precondition) (a) same helper same
test-issue-1470-node-tile-helper.js Kpa-clawbot#1533 renamed voyager-inverted to carto-voyager-dark and Kpa-clawbot#1614 made provider.url a lazy function. MC_setDarkTileProvider() returns false for an unknown id, so the default stayed active. (a) new id, resolve lazy url, assert the setter accepted selected provider, getTileUrl, _applyTilesToNodeMap url and invert filter

Nothing was deleted: no test was redundant.

Real regression found (separate commit, public/roles.js)

ROLE_COLORS is a live getter that reads --mc-role-* on documentElement. Since Kpa-clawbot#1449 an active colourblind preset is delivered only through body[data-cb-preset], which documentElement never sees. Under a preset, CSS-variable consumers showed the preset while every JS consumer of ROLE_COLORS (analytics, map, nodes, live, route views) kept the Wong default.

Observed in the browser with meshcore-cb-preset=deut, before the fix: body computes --mc-role-repeater #FE6100, documentElement #D55E00, ROLE_COLORS.repeater #D55E00. Applying prot at runtime did not change ROLE_COLORS either.

Fix: _readCssVar resolves on <body> (fallback documentElement). <body> inherits every :root value, so reads without a preset are unchanged. Regression test: new section G in test-issue-1407-cb-preset-propagation.js (red on the old roles.js). This commit is independent: drop it if you would rather handle it in its own PR; the test commits do not depend on it.

No production file on the do-not-touch list was changed. No real regression was found in channels.js.

Mutants (run in a copy of the tree)

Test Mutant Result
frontend-helpers favStarIconHtml always ph-star red (filled-star test)
frontend-helpers favStarIconHtml always ph-star-fill red (empty-star test)
frontend-helpers remove the contains() stub stays green: it only silences 13 log lines
channel-psk-ux user-added badge switched to ph-lock red
analytics-channels re-add a #/analytics chip text to channels.js red
1648-m3 extra emoji in the avatar / pong line red
1438 / 1446 server colour written to --mc-role-* while a preset is active 1438 red, 1446 green
1438 style.css deut companion colour changed 1438 red
1446 style.css deut repeater colour changed 1446 red
1470 invert filter not applied / getTileUrl ignores provider / getActiveTileProvider returns null / voyager url wrong red in each case
1407 §G old roles.js red

Results

test-all.sh file list (104 files), each file run on its own, 120 s limit, Node v26 locally.

failing files
master 84c637ea 12 (exactly the list in #174)
this branch 5: test-observers-headings.js, test-issue-1648-m6-final-sweep.js, test-issue-1648-m6-lint-self.js, test-issue-1485-live-anim-z.js, test-naive-banner-tone.js (all part A)

No new failures. Every other test file that loads roles.js has the same exit code on master and on this branch, apart from the ones this PR repairs.

Also failing on master, not in test-all.sh, not touched here: test-map-clustering.js (makeClusterIcon pill assertion).

Browser (local server, e2e fixture DB, branch public/)

  • Presets deut, prot, trit, achromat: body computes exactly the preset table values, and ROLE_COLORS now matches them; clearPreset() returns to the server palette.
  • Dark mode: MC_setDarkTileProvider('carto-voyager-dark') returns true, getTileUrl() is the voyager url, getActiveTileProvider() carries the invert filter, the old id voyager-inverted is rejected. On a real node detail page the inset map loaded voyager tiles and the tile pane had the invert filter.
  • Channel sidebar at 1280 px: a user-added PSK row renders ph-lock-open. At phone width the row renders ph-key (a separate mobile renderer, not changed here).

Not verified

  • A server-encrypted channel row (ph-lock) in the browser: the fixture has no encrypted channels. Only the source mapping is tested.
  • Presets were applied through MeshCorePresets in the page, not by clicking through the customizer panel.
  • Node 22 (CI version); CI does not run these files today.
  • No screenshots (browser pane).

🤖 Generated with Claude Code

dborup and others added 7 commits October 2, 2026 19:09
…y.contains (#174)

favStar() was migrated from the ★/☆ text glyphs to a Phosphor sprite
<svg> in Kpa-clawbot#1648 M2, so the two favStar assertions grepping for the glyphs
failed. Assert the sprite id (ph-star-fill / ph-star), the "on" class and
aria-pressed instead.

The nodes WS sandbox lacked element.contains(), which renderRows() has
called since Kpa-clawbot#1616, so 13 "Failed to load nodes: tbody.contains is not a
function" errors were logged during the run. Add the stub.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… glyph (#174)

channels.js renders the user-added/encrypted badge with Phosphor sprite
icons since Kpa-clawbot#1648 M2 (ph-lock-open vs ph-lock), so grepping the source for
the 🔓 glyph failed. Assert the badgeIcon mapping instead: user-added rows
use ph-lock-open, server-encrypted rows use ph-lock.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…o analytics (#174)

The "Channel Analytics" chip on the Channels page (Kpa-clawbot#1042) was dropped on
purpose by the chat-app redesign (Kpa-clawbot#1376); test-issue-1367-channels-chat-app-e2e.js
asserts the rendered header has no analytics link. The old source-grep
assertion therefore failed. Invert it into a source-level guard that the
#/analytics link and .ch-analytics-link chip stay gone.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…wly (#174)

The ping bot (2026-07-23) added two emoji to channels.js after the M3 sweep:
- '🏓 pong! ' is the text of the CoreScopeBot reply, i.e. message content
  rather than UI iconography.
- the 🤖 avatar is UI iconography, but the Phosphor sprite has no robot
  symbol yet, so it cannot be swapped without touching channels.js and the
  sprite. Allowlist it as a known exception with a TODO.

Both entries match whole substrings, so any other emoji in channels.js (or
a changed bot avatar/reply) still fails the scan.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…t the root inline (#174)

Since Kpa-clawbot#1449 customize-v2 applyCSS removes the documentElement
--mc-role-{role} write when a CB preset is active and the role has no user
override, so the preset colour is delivered only by the
body[data-cb-preset="X"] rule in style.css. The Kpa-clawbot#1438 FINAL C and Kpa-clawbot#1446
scenario 5 assertions still read the documentElement inline style, which is
now empty, and failed.

Model the browser cascade in the sandbox (body inline > body[data-cb-preset]
rule parsed from style.css > root inline) and assert the effective value.
The server colour must still stay out of the documentElement --mc-role-*
write while a preset is active.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
…rovider urls (#174)

Kpa-clawbot#1533 renamed the dark Voyager provider 'voyager-inverted' to
'carto-voyager-dark' and made provider.url a lazy function (Kpa-clawbot#1614).
MC_setDarkTileProvider() silently returns false for an unknown id, so the
test stayed on the default carto-dark and every voyager assertion failed.

Select the current id, assert the setter accepted it so a future rename
fails loudly at the cause, and resolve provider.url before matching.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
… reaches JS consumers (#174)

Found while repairing the Kpa-clawbot#1438/Kpa-clawbot#1446 customizer tests. Since Kpa-clawbot#1449,
customize-v2 applyCSS removes the documentElement --mc-role-{role} write
when a CB preset is active and the role has no user override; the preset
colour is then delivered only by the body[data-cb-preset="X"] rule in
style.css. The live ROLE_COLORS getter (Kpa-clawbot#1407) resolved the variable on
documentElement, which never sees a body-scoped rule, so under a preset it
kept returning the Wong default while CSS-var consumers showed the preset.

Observed in the browser with meshcore-cb-preset=deut: body computes
--mc-role-repeater #FE6100, documentElement #D55E00 and ROLE_COLORS.repeater
#D55E00 (also after MeshCorePresets.applyPreset('prot') at runtime).
ROLE_COLORS is read by analytics, map, nodes, live and the route views.

Resolve the variable on <body> (falling back to documentElement). <body>
inherits every :root value, so reads without a preset are unchanged.
Regression test added to test-issue-1407-cb-preset-propagation.js.

Relates to #174

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@dborup
dborup marked this pull request as ready for review October 3, 2026 06:56
@dborup
dborup merged commit 470033e into master Oct 3, 2026
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant