mirror of
https://github.com/Kpa-clawbot/meshcore-analyzer.git
synced 2026-05-31 15:14:02 +00:00
ac0cf5ac7d
Red commit: 5def4d073c61058fc9f327a3c60ece27e21cbc69 (CI run pending — see Checks tab) Fixes #1087 ## What's broken (4 bugs) 1. **"QR library not loaded"** — `channel-qr.js` checked `root.QRCode` (capital), but the vendored library exports lowercase `qrcode` (Kazuhiko Arase API). Generate & Show QR always fell into the "library not loaded" branch. 2. **QR encodes `name=psk:hex`** — the Share button (and parts of the Generate path) passed the internal `psk:<hex8>` lookup key to `ChannelQR.generate`, ignoring the user's display label stored in `LABELS_KEY`. 3. **PSK channel doesn't persist on refresh** — the persistence path was scattered, and the read-back wasn't verified. Added channels disappeared on refresh and "reappeared" only when a later add ran the persist hook. 4. **Share button reuses the Add Channel modal** — wrong intent reuse (Add = INPUT, Share = OUTPUT). Replaced with a dedicated `#chShareModal` (separate DOM id, separate title, share-only affordances, privacy warning). ## TDD Red commit (this) lands ONLY the failing tests: - `test-channel-issue-1087.js` — source-string contract assertions for all 4 bugs - `test-channel-issue-1087-e2e.js` — Playwright E2E covering generate → QR render, QR display name, persistence across refresh, Share opens dedicated modal Green commit (follow-up) lands the production fixes. ## E2E assertion added E2E assertion added: test-channel-issue-1087-e2e.js:55 ## CI wiring - `test-channel-issue-1087.js` added to `.github/workflows/deploy.yml` (go-test JS unit step) + `test-all.sh` - `test-channel-issue-1087-e2e.js` added to `.github/workflows/deploy.yml` (e2e-test step) --------- Co-authored-by: bot <bot@corescope> Co-authored-by: meshcore-bot <bot@meshcore.local> Co-authored-by: clawbot <clawbot@users.noreply.github.com>
20 lines
1.0 KiB
Bash
20 lines
1.0 KiB
Bash
#!/bin/sh
|
|
# Instrument frontend JS for coverage tracking
|
|
rm -rf public-instrumented
|
|
npx nyc instrument public/ public-instrumented/ --compact=false
|
|
# Copy non-JS files (CSS, HTML, images) as-is
|
|
cp public/*.css public-instrumented/ 2>/dev/null
|
|
cp public/*.html public-instrumented/ 2>/dev/null
|
|
cp public/*.svg public-instrumented/ 2>/dev/null
|
|
cp public/*.png public-instrumented/ 2>/dev/null
|
|
# Copy vendored libraries unmodified — `nyc instrument` skips subdirectories
|
|
# without a package.json, so vendor/qrcode.js, vendor/jsqr.min.js, etc. are
|
|
# never emitted into public-instrumented/. Without them the SPA fallback
|
|
# returns index.html for `<script src="vendor/qrcode.js">`, producing
|
|
# "Unexpected token '<'" pageerrors and a missing `qrcode` global —
|
|
# which makes the QR Generate path hit the "[QR library not loaded]"
|
|
# fallback in channel-qr.js (issue #1087 bug 1 manifests in CI only).
|
|
mkdir -p public-instrumented/vendor
|
|
cp public/vendor/* public-instrumented/vendor/ 2>/dev/null
|
|
echo "Frontend instrumented successfully"
|