Repository navigation
Commit c8d3ef3
authored
fix(e2e/helpers): navTo throws when the nav item is absent (TK-012) (#412)
Independent review: APPROVE.
# Review #412 r2: TK-012, navTo throws when the menu item is missing
Head 8b3cd21 (merges origin/master 90a2d36). Delta against the r1 review (412.md, CHANGES). Read-only detached worktree, no GitHub comment.
## What I ran
| Check | Result |
|---|---|
| `tests/wave2/test-navto-missing-item.sh` on head | 7 of 7 ok, rc 0 |
| same test against origin/master's `project-tests/e2e` | 4 FAIL (absent item, message, empty menu, walkthrough nav), rc 1 |
| `bin/check-pr-discipline.sh origin/master` | clean |
| Mutation: re-indent the closing brace of `case 'nav'` in a copy of the walkthrough | test crashes (SyntaxError, non-zero exit): loud, not green |
| Mutation: remove the try/catch (master's walkthrough) | walkthrough case FAIL |
## r1 points
| # | Asked | Status |
|---|---|---|
| 1 | Walkthrough `nav` case catches the throw and returns `step(meta, false, label, e.message)`; stub case | **Fixed.** Lines 208 to 210. The callers at 525/546 still decide on `s.fatal`, so a non-fatal missing item is a recorded failed step and the walk continues. Covered by the test. |
| 2 | Message names user and visible items, separates journey fix from grant fix | **Fixed.** Visible `a[title]` values are collected in the same `evaluate`, deduped; empty menu reads `(none)`. Three test cases pin it. |
| 3 | CHANGELOG: correct the monkey claim, name full-app-walkthrough | **Fixed.** Monkey "swallows the error and still checks `.mx-page`, so monkey is unchanged" matches `monkey.js:166-168`. Walkthrough named with the `fatal` rule. |
| 4 | Impact Process row with the measured result plus the walkthrough change | **Fixed in substance.** Walkthrough change and design-audit `fault` rows are stated. Wording nit below. |
## The walkthrough test that regex-extracts the `nav` case
Acceptable, no refactor required for this PR. Reasons:
- It fails loud, not green. A layout change that breaks the regex gives `m = null` and an explicit FAIL; a changed brace indentation crashes the AsyncFunction constructor with a non-zero exit; removing the catch FAILs the case. I found no edit that keeps the test green while losing the behaviour.
- The clean alternative (export `runStep` and guard the top-level IIFE at line 424 with `require.main === module`) changes how a 680-line entry script starts and pulls module-level state (`stoppedAt`, `cfg`, `PROJ`) into the test. That is wider than a 4-file fix.
- The one real gap: a future free variable used on the failure path of the `nav` case (not passed as a parameter) would surface as a ReferenceError, again a loud FAIL.
Suggest as a follow-up (not blocking): when the walkthrough is next touched, export `runStep` behind a `require.main` guard and replace the regex with a `require`.
## Nits (body only, no re-review needed)
1. Process row and Field evidence say "0 of 30 turn red, and the 4 broken controls ... now correctly fail". The 4 controls are inside the 30, so the sentence contradicts itself. Measured: 22 real journeys stay green (0 newly red), 4 home-page controls turn red as intended, 3 already red now fail earlier with a clearer cause, 1 placeholder unchanged.
2. Test-tier checkbox: "Run against master ... 2 of 3 pass" is stale. On master the test now prints 2 ok and 4 FAIL.
## Verdict: APPROVE
All four r1 points are fixed and the behaviour is tested, including the walkthrough path. Fix the two body nits before marking ready.1 parent 03d8116 commit c8d3ef3
4 files changed
Lines changed: 71 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| 22 | + | |
22 | 23 | | |
23 | 24 | | |
24 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
205 | 205 | | |
206 | 206 | | |
207 | 207 | | |
208 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
209 | 211 | | |
210 | 212 | | |
211 | 213 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
487 | 487 | | |
488 | 488 | | |
489 | 489 | | |
490 | | - | |
491 | | - | |
492 | | - | |
| 490 | + | |
| 491 | + | |
| 492 | + | |
| 493 | + | |
| 494 | + | |
493 | 495 | | |
494 | | - | |
| 496 | + | |
| 497 | + | |
| 498 | + | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
495 | 505 | | |
496 | 506 | | |
497 | 507 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
0 commit comments