Repository navigation
test: repair 7 failing test-all.sh files, fix ROLE_COLORS under a CB preset (#174 part B) - #178
Merged
Merged
Conversation
…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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Part B of #174: repairs the seven failing
test-all.shfiles 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
test-frontend-helpers.jsfavStar()moved from the ★/☆ glyphs to a Phosphor sprite<svg>in Kpa-clawbot#1648 M2; the two assertions still grepped for the glyphs. Thetbody.contains is not a functionlog (13 times) was a missingcontains()on the nodes WS sandbox element;renderRows()has called it since Kpa-clawbot#1616. The log did not fail the run.#ph-star-fill/#ph-star, theonclass andaria-pressedtest-channel-psk-ux.jschannels.jsusesph-lock-open/ph-lockinstead of 🔓/🔒 since Kpa-clawbot#1648 M2badgeIconmapping: user-added →ph-lock-open, encrypted →ph-locktest-analytics-channels-integration.js#/analytics/.ch-analytics-linkstay out ofchannels.js; the rendered header is covered bytest-issue-1367-channels-chat-app-e2e.jstest-issue-1648-m3-emoji-scan.js🏓 pong!(reply text) and a🤖avatar tochannels.jsafter the M3 sweepchannels.jsstill fails. The🤖avatar is real iconography and is only exempted because the sprite has no robot symbol; TODO in the test to addph-robotand drop the entrytest-issue-1438-customizer-mcrole.jsapplyCSSremoves thedocumentElement--mc-role-*write while a preset is active, so the preset colour only comes frombody[data-cb-preset]instyle.css. The test read the root inline style (now empty).body[data-cb-preset]rule parsed fromstyle.css> root inline; server colour must still stay out of the root writetest-issue-1446-cb-preset-cascade.jstest-issue-1470-node-tile-helper.jsvoyager-invertedtocarto-voyager-darkand Kpa-clawbot#1614 madeprovider.urla lazy function.MC_setDarkTileProvider()returnsfalsefor an unknown id, so the default stayed active.getTileUrl,_applyTilesToNodeMapurl and invert filterNothing was deleted: no test was redundant.
Real regression found (separate commit,
public/roles.js)ROLE_COLORSis a live getter that reads--mc-role-*ondocumentElement. Since Kpa-clawbot#1449 an active colourblind preset is delivered only throughbody[data-cb-preset], whichdocumentElementnever sees. Under a preset, CSS-variable consumers showed the preset while every JS consumer ofROLE_COLORS(analytics, map, nodes, live, route views) kept the Wong default.Observed in the browser with
meshcore-cb-preset=deut, before the fix:bodycomputes--mc-role-repeater#FE6100,documentElement#D55E00,ROLE_COLORS.repeater#D55E00. Applyingprotat runtime did not changeROLE_COLORSeither.Fix:
_readCssVarresolves on<body>(fallbackdocumentElement).<body>inherits every:rootvalue, so reads without a preset are unchanged. Regression test: new section G intest-issue-1407-cb-preset-propagation.js(red on the oldroles.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)
favStarIconHtmlalwaysph-starfavStarIconHtmlalwaysph-star-fillcontains()stubph-lock#/analyticschip text tochannels.js--mc-role-*while a preset is activestyle.cssdeut companion colour changedstyle.cssdeut repeater colour changedgetTileUrlignores provider /getActiveTileProviderreturns null / voyager url wrongroles.jsResults
test-all.shfile list (104 files), each file run on its own, 120 s limit, Node v26 locally.84c637eatest-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.jshas 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(makeClusterIconpill assertion).Browser (local server, e2e fixture DB, branch
public/)deut,prot,trit,achromat: body computes exactly the preset table values, andROLE_COLORSnow matches them;clearPreset()returns to the server palette.MC_setDarkTileProvider('carto-voyager-dark')returnstrue,getTileUrl()is the voyager url,getActiveTileProvider()carries the invert filter, the old idvoyager-invertedis rejected. On a real node detail page the inset map loaded voyager tiles and the tile pane had the invert filter.ph-lock-open. At phone width the row rendersph-key(a separate mobile renderer, not changed here).Not verified
ph-lock) in the browser: the fixture has no encrypted channels. Only the source mapping is tested.MeshCorePresetsin the page, not by clicking through the customizer panel.🤖 Generated with Claude Code