22541 extract simple link-text breadcrumb route map and add structure tests
This commit is contained in:
@@ -361,6 +361,37 @@ Follow-ups:
|
||||
|
||||
- Next slice recommendation: extract a second tiny map for simple "link + text" pair routes (no callbacks, no side effects) to further shrink the conditional chain while keeping callback/dynamic branches explicit.
|
||||
|
||||
### CL-22541-M: breadcrumbs simple link+text pair map + focused structure coverage
|
||||
|
||||
date: 2026-04-09
|
||||
author: Cline
|
||||
scope: `components/breadcrumbs.js`, `tests/phase22/{breadcrumbs-route-map-structure,index}.test.cjs`
|
||||
type: change
|
||||
rationale: Execute the next bounded slice by extracting simple link+text pair route branches into a tiny renderer map and adding focused regression checks that mapped and dynamic callback branches remain in the intended structure.
|
||||
impact: Refactor-only structural deduplication/readability improvement plus focused test coverage; no intended route/auth/session/API/EN-CY/a11y behavior change.
|
||||
status: completed
|
||||
|
||||
Summary:
|
||||
|
||||
- Added `getSimpleLinkTextPairRenderer(path)` in `components/breadcrumbs.js` for simple no-callback "link + text" pair routes.
|
||||
- Migrated these routes into the new pair map:
|
||||
- `/addresssearchresults`
|
||||
- `/advancedsearchresults`
|
||||
- Kept dynamic/callback-driven branches explicit and untouched (e.g., `/myportal/case/id/[incident]` with `router.back()`).
|
||||
- Added focused phase22 suite `tests/phase22/breadcrumbs-route-map-structure.test.cjs` asserting:
|
||||
- mapped simple pair routes exist in the new map
|
||||
- explicit dynamic callback branch remains present.
|
||||
- Registered the new suite in `tests/phase22/index.test.cjs`.
|
||||
|
||||
Validation:
|
||||
|
||||
- `npx eslint components/breadcrumbs.js tests/phase22/index.test.cjs tests/phase22/breadcrumbs-route-map-structure.test.cjs` -> pass.
|
||||
- `node tests/phase22/index.test.cjs` -> pass (combined suite, including new breadcrumbs-route-map tests 2/2).
|
||||
|
||||
Follow-ups:
|
||||
|
||||
- Next slice recommendation: introduce a tiny local `renderMappedRoute(path, resolver)` helper to remove repeated inline IIFE map invocations, then optionally merge simple maps under one top-level resolver while preserving explicit ordering and side-effect-free constraints.
|
||||
|
||||
### CL-00X: 22500 `components/elements/index.js` Phase 1 helper extraction
|
||||
|
||||
date: 2026-04-07
|
||||
|
||||
Reference in New Issue
Block a user