You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit b151b6f
Browse filesBrowse the repository at this point in the historyBrowse files
chore: remove dead routes and add non screen marker to the routes <=> POM registry (#47742)
<!--
Please submit this PR as a draft initially.
Do not mark it as "Ready for review" until the template has been
completely filled out, and PR status checks have passed at least once.
-->
## **Description**
The route page object registry mapped 89 routes to `null`. An audit of
those routes found two problems.
1. Some routes are dead. No UI code navigates to them or renders them,
because the screens behind them were removed long ago:
- `/networks/form`, `/networks/add-network`,
`/networks/add-popular-custom-network` (legacy network settings, removed
in #41945 and #42255)
- `/import-token`, `/import-tokens`, `/confirm-import-token` (token
import moved to a modal in #19553)
- `/remote`, `/remote/setup-swaps`, `/remote/setup-daily-allowance`
(remote mode removed in #34041)
- `/initialize/experimental-area` (old onboarding flow removed in
#17081)
- `/onboarding/help-us-improve` (no references)
2. Some routes never render a screen of their own, but the registry
showed them as "no page object yet", the same as screens that are
missing tests:
- `/lock` runs the lock action.
- `/settings-v2` and `/musd` only redirect.
- `/new-account` and `/onboarding` only host nested routes.
- `/perps` has no router entry.
This PR:
- Removes the 11 dead routes: their constants, their `ROUTES` entries,
their registry entries, and the leftover mm-cli references in
`extension-launcher.ts` and `state-inspector.ts`.
- Adds a `NOT_A_SCREEN` marker to the route registry and uses it for the
6 routes above. The coverage report shows these routes with a
`not-a-screen` status and a "Not a screen" count, and leaves them out of
the coverage percentage.
<!--
Write a short description of the changes included in this pull request,
also include relevant motivation and context. Have in mind the following
questions:
1. What is the reason for the change?
2. What is the improvement/solution?
-->
## **Changelog**
<!--
If this PR is not End-User-Facing and should not show up in the
CHANGELOG, you can choose to either:
1. Write `CHANGELOG entry: null`
2. Label with `no-changelog`
If this PR is End-User-Facing, please write a short User-Facing
description in the past tense like:
`CHANGELOG entry: Added a new tab for users to see their NFTs`
`CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker`
(This helps the Release Engineer do their job more quickly and
accurately)
-->
CHANGELOG entry:
## **Related issues**
Fixes:
## **Manual testing steps**
1. Go to this page...
2.
3.
## **Screenshots/Recordings**
<img width="740" height="233" alt="image"
src="https://github.com/user-attachments/assets/4e5244d5-33f6-46c1-896d-212a5f0580ea"
/>
### **Before**
<!-- [screenshots/recordings] -->
### **After**
<!-- [screenshots/recordings] -->
## **Pre-merge author checklist**
- [ ] I've followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask
Extension Coding
Standards](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-extension/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.
## **Pre-merge reviewer checklist**
- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> Test tooling and route constant cleanup only; no production UI or auth
paths changed beyond deleting unused route definitions.
>
> **Overview**
> Introduces a **`NOT_A_SCREEN`** marker in the E2E route ↔ page-object
registry for paths that redirect, run an action, or only host nested
routes (e.g. `/lock`, `/onboarding`, `/settings-v2`). The route coverage
report and **`getRouteCoverage`** now surface a `not-a-screen` status,
count them separately, and **exclude them from the coverage percentage**
so missing POMs are not conflated with non-screens.
>
> **Removes 11 dead routes** from `ui/helpers/constants/routes.ts`
(`ROUTES` and exported constants): legacy network form routes, old token
import/confirm paths, remote mode routes,
`initialize/experimental-area`, and `onboarding/help-us-improve`.
Registry entries and related references in Playwright
**extension-launcher** and **state-inspector** are aligned (e.g. drop
`CONFIRM_IMPORT_TOKEN`, map metametrics only via
`ONBOARDING_METAMETRICS`).
>
> Docs (**`AGENTS.md`**) and tests for registry/coverage are updated to
describe and enforce the new marker.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
f9c408f. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
Copy file name to clipboardExpand all lines: test/e2e/AGENTS.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -40,6 +40,6 @@ Write E2E correctly from the start using `mms-extension-testing`. Before submitt
40
40
| Page object importing/calling another page object | Flow that owns both page objects |
41
41
|`try` / `catch` in page objects or flows | Let failures surface via waits / `check*` messages |
42
42
43
-
**Route registry:** when you add a page object for a full screen that has its own route, map it in [route-registry/route-registry.ts](./route-registry/route-registry.ts), replacing `null`. Skip this for page objects that cover modals or components. It is optional and never blocks a PR; only adding or removing routes is enforced, by `route-registry.test.ts`.
43
+
**Route registry:** when you add a page object for a full screen that has its own route, map it in [route-registry/route-registry.ts](./route-registry/route-registry.ts), replacing `null`. Skip this for page objects that cover modals or components. Use `NOT_A_SCREEN` for routes that only redirect, run an action or host nested routes, so they are left out of the coverage percentage. It is optional and never blocks a PR; only adding or removing routes is enforced, by `route-registry.test.ts`.
44
44
45
45
Run `yarn skills` after `yarn install` if `.cursor/rules/mms-extension-testing/` is missing locally.
0 commit comments