Skip to content

[Testing][E2E] Route-affordance walk: doc precision and dead-branch follow-ups from the #2679 review #2682

Description

@Chris0Jeky

Follow-ups from the fresh-context review of PR #2679 (head 2df5d4c39), all non-blocking under the severity bar; none is a correctness defect in a shipped row. Test-only, the three files PR #2673 created.

  1. Header pointer (MEDIUM in the review, doc precision). tests/e2e/route-affordances.spec.ts:36 says which defence applies to each walked response row is "stated per row in the inventory". The header's own two-bullet enumeration is accurate for all ten walked response rows, but home.quick-capture-submit, inbox.archive and review.approve carry no comment in routeAffordanceInventory.ts, and calendar.next-month's comment explains only the exact-string post-condition. Either add the per-row note to those four rows or drop the "stated per row" clause.
  2. Token-substitution doc names the wrong surfaces (LOW). routeAffordanceInventory.ts:72-75 says the tokens are substituted in url and response pattern strings; {openingMonthLabel} appears only in text.text and textChangedFrom.from, and fillTokens is applied to value.value, text.text, textChangedFrom.from and role-selector name, not to attribute.*, enabled.selector, node/focus test ids or css selectors. State the real list, or apply fillTokens uniformly.
  3. assertEnabled reads are dead branches (LOW). The guarded status variant declares assertEnabled: true as a required literal, so the guard's !== true throw and the walk's if (affordance.status.assertEnabled) cannot take their false branch, and the assertion-8 docblock describes a per-row choice the type forecloses; unlike the response branch (assertion 9), the check has no canary. Either widen the type to boolean with a canary, or say in both places that the type is the enforcement and the runtime read is belt-and-braces.
  4. textChangedFrom is a negated matcher (LOW, hypothesis to confirm). expect(locator).not.toHaveText(x) is expected to pass when the locator resolves to zero elements. Assertion 8 classifies the kind as element-asserted and offers it for guarded rows. The shipped calendar.previous-month row is masked by calendar.next-month's positive text check one row later. Confirm the zero-element semantics; if confirmed, pair the kind with an explicit toHaveCount(1) (or toBeVisible()) on the same locator before the negation.
  5. The calendar mount read is armed without the parked-outcome handler (LOW). route-affordances.spec.ts:542-547 arms the calendar GET before page.goto and awaits it on the next line; if page.goto throws, the 30 s waitForResponse rejection has no handler. The metrics, notifications and home mount reads predate PR test(e2e): exhaustive consequence dispatch, calendar mount consumption and truthful post-condition docs in the route walk #2679 and have the same shape. Apply the parking pattern from activate to all four.

Also noted, informational: a postCondition: { kind: 'response' } on any row passes typecheck and the vitest guard and throws only inside E2E Smoke (expectConsequence's response case); that is the documented design, recorded here so the limit of the cheap gate is written down.

Refs #1949, #2678, PR #2673, PR #2679.

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

    frontendPrimary implementation impact in Vue/TypeScript UI and client runtime.testingTest coverage, harnesses, regression prevention, and verification pipeline work.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions