Conversation
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
a88ed52 to
4541925
Compare
4541925 to
468e216
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
Since these are purely test refactoring changes (improving test consistency by using shared mocks) and a linting rule addition, no E2E tests are needed. The production Snaps UI components remain unchanged, so there's no risk to user-facing functionality. Performance Test Selection: |
| }, | ||
| }, | ||
| { | ||
| files: ['app/components/Snaps/**/*.{js,jsx,ts,tsx}'], |
There was a problem hiding this comment.
This scoped override is a good incremental rollout point for Snaps. It enforces color-no-hex in production + tests under app/components/Snaps/** without broadening conflicts in unrelated codeowner areas.
| import { fireEvent, waitFor } from '@testing-library/react-native'; | ||
| import ClipboardManager from '../../../../core/ClipboardManager'; | ||
| import { Copyable } from '@metamask/snaps-sdk/jsx'; | ||
| import { mockTheme } from '../../../../util/theme'; |
There was a problem hiding this comment.
Importing mockTheme from util/theme here removes duplicated local test-theme definitions and keeps this test aligned with the shared theme contract used across the app.
| key: expect.any(String), | ||
| props: { | ||
| color: '#4459ff', | ||
| color: mockTheme.colors.info.default, |
There was a problem hiding this comment.
Asserting mockTheme.colors.info.default instead of a literal hex makes this expectation resilient to token updates while still validating that link text uses the semantic info color.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #26958 +/- ##
==========================================
- Coverage 81.68% 81.51% -0.18%
==========================================
Files 4606 4627 +21
Lines 120574 121093 +519
Branches 26372 26453 +81
==========================================
+ Hits 98496 98706 +210
- Misses 15196 15480 +284
- Partials 6882 6907 +25 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|



Description
Continues the color-no-hex cleanup in small codeowner batches by updating the Snaps (
@MetaMask/core-platform) tests to remove hardcoded hex color expectations and local hex theme mocks.This follows the same pattern as the original PR:
mockThemefromutil/thememockTheme.colors.info.default) instead of literal hex stringsChangelog
CHANGELOG entry: null
Related issues
Fixes:
Related: #26651
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Low runtime risk since changes are limited to tests and ESLint config, but enabling
color-no-hexas an error for allapp/components/Snapsfiles could surface new lint failures across that folder.Overview
Enables stricter linting for Snaps theming. ESLint now enforces
@metamask/design-tokens/color-no-hexas an error forapp/components/Snaps/**/*.Updates Snaps tests to use token-backed theme values. Snap UI tests (
copyable,link, andSnapUISpinner) stop using hardcoded hex colors/local theme mocks and instead import the sharedmockThemeand assert against values likemockTheme.colors.info.default/mockTheme.colors.primary.default.Written by Cursor Bugbot for commit 468e216. This will update automatically on new commits. Configure here.