chore: upgrade design system packages @metamask/design-tokens@8.2.1#26639
chore: upgrade design system packages @metamask/design-tokens@8.2.1#26639georgewrmarshall merged 2 commits intomainfrom
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. |
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
e4067f1 to
1e82eba
Compare
277e8f7 to
bbb662c
Compare
bbb662c to
eb9297e
Compare
Replace hardcoded hex color values with design token references in test files to make tests resilient to future design token upgrades. This unblocks PR #26639 (design token upgrade to v8.2.1) by ensuring tests assert the correct design token is used rather than specific hex values that change between token versions. Updated test files: - app/components/Snaps/SnapUIRenderer/components/input.test.ts - app/components/UI/Bridge/components/TransactionDetails/BridgeStepDescription.test.tsx - app/components/UI/Card/components/Onboarding/VerifyIdentity.test.tsx - app/components/UI/Earn/Views/EarnLendingWithdrawalConfirmationView/EarnLendingWithdrawalConfirmationView.test.tsx - app/components/UI/Rewards/hooks/useRewardsToast.test.tsx - app/components/Views/confirmations/components/UI/info-row-divider/info-row-divider.test.tsx Approach: - Import lightTheme from @metamask/design-tokens - Replace hex values with lightTheme.colors.* references - Update theme mocks to use jest.requireActual('@metamask/design-tokens') - Update snapshots to reflect new token values
#26657) ## **Description** This PR updates test files to use design token references instead of hardcoded hex values, unblocking the design tokens upgrade to v8.2.1 (#26639). **What this PR does:** - Replaces hardcoded color hex values with `mockTheme.colors.*` references in test assertions - Uses `brandColor.*` for static, non-theme-dependent colors (camera overlay) - Updates snapshots to reflect new design token values - Fixes template interpolation in inline snapshots **Why this is an improvement:** - Makes tests resilient to design token value changes - Ensures tests validate correct token usage rather than specific hex values - Aligns with design system best practices ## **Changelog** CHANGELOG entry: null ## **Related issues** Dependency of: #26639 Related: #26651 ## **Manual testing steps** ```gherkin Scenario: Verify all updated tests pass Given the repository with design tokens v8.2.1 When I run the following test files: | Test File | | app/components/Snaps/SnapUIRenderer/components/input.test.ts | | app/components/UI/Bridge/components/TransactionDetails/BridgeStepDescription.test.tsx | | app/components/UI/Card/components/Onboarding/VerifyIdentity.test.tsx | | app/components/UI/Earn/Views/EarnLendingWithdrawalConfirmationView/EarnLendingWithdrawalConfirmationView.test.tsx | | app/components/UI/Rewards/hooks/useRewardsToast.test.tsx | | app/components/Views/confirmations/components/UI/info-row-divider/info-row-divider.test.tsx | Then all tests should pass And snapshots should match expected values ``` ## **Screenshots/Recordings** N/A - Test-only changes ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. - [x] I've properly set the pull request status: - [x] In case it's not yet "ready for review", I've set it to "draft". - [x] In case it's "ready for review", I've changed it from "draft" to "non-draft". ## **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-only changes that update assertions to reference theme tokens, reducing brittleness during design-token updates. Low risk aside from potential snapshot/assertion adjustments if token mappings differ. > > **Overview** > Updates several UI/unit tests to assert against theme design tokens (via `mockTheme.colors.*`) instead of hardcoded hex values, including Snap UI input borders, Bridge step text colors, Earn navbar background, and Rewards toast icon colors. > > Adjusts tests that relied on inline snapshots/mocked theme shapes by switching to token-backed assertions (and using `brandColors` for static camera overlay colors in Veriff branding) to keep tests resilient to design-token value changes. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 04dc67e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY --> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
6e4ad60 to
ca5ff31
Compare
| ); | ||
| expect(getBackgroundColor(mockTheme, true, true)).toEqual( | ||
| mockTheme.colors.error.default, | ||
| ); |
There was a problem hiding this comment.
Moved to a separate PR to remove code owner friction and this PR becoming stale due to snapshot sensitivity
…d assertions (#26710) ## **Description** Updates `amount-keyboard.test.tsx` to use `mockTheme` design token references instead of hardcoded hex values in test assertions, unblocking the design tokens upgrade to v8.2.1 (#26639). **What this PR does:** - Replaces hardcoded color hex values (`#b7bbc8`, `#121314`, `#ca3542`) with `mockTheme.colors.*` references in test assertions for `getBackgroundColor` and the disabled Next button **Why this is an improvement:** - Makes tests resilient to design token value changes - Ensures tests validate correct token usage rather than specific hex values - Aligns with design system best practices - Follows the same pattern established in #26657 ## **Changelog** CHANGELOG entry: null ## **Related issues** Dependency of: #26639 Related: #26657 ## **Manual testing steps** ```gherkin Scenario: Verify updated tests pass Given the repository with design tokens v8.2.1 When I run app/components/Views/confirmations/components/send/amount/amount-keyboard/amount-keyboard.test.tsx Then all 6 tests should pass ``` ## **Screenshots/Recordings** N/A - Test-only changes ## **Pre-merge author checklist** - [x] I've followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [x] I've completed the PR template to the best of my ability - [x] I've included tests if applicable - [x] I've documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [x] I've applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/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-only updates that swap fixed hex assertions for `mockTheme` token references, reducing brittleness during design token upgrades. No production logic changes; risk limited to potential mismatches with token names/structure. > > **Overview** > Updates `amount-keyboard.test.tsx` to stop asserting on hardcoded hex colors for the disabled Next/Continue button and `getBackgroundColor` output. > > Assertions now reference `mockTheme.colors.text.*` and `mockTheme.colors.error.*`, making the tests resilient to design token value changes while still verifying the correct token is used. > > <sup>Written by [Cursor Bugbot](https://cursor.com/dashboard?tab=bugbot) for commit 95e250e. This will update automatically on new commits. Configure [here](https://cursor.com/dashboard?tab=bugbot).</sup> <!-- /CURSOR_SUMMARY -->
3170193 to
2666ac0
Compare
5ade5c2 to
1ac4c05
Compare
1ac4c05 to
610c6ed
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection: Snapshot files are regenerated when:
Since these changes:
No E2E tests are required. The snapshot updates themselves will be validated by the unit test suite (Jest) which will verify the snapshots match the current component output. Performance Test Selection: |
Description
Upgrades design system packages to their latest versions:
@metamask/design-system-react-native:^0.7.0→^0.8.0RadioButtoncomponent for radio button form controlsBadgeStatusmigrated from TypeScript enums to string union types with const objects (no migration required)BottomSheetFootercomponent location for better organization@metamask/design-tokens:^8.2.0→^8.2.1@metamask/design-system-shared:^0.1.3→^0.2.0(transitive dependency)BadgeStatustypes and constantsChangelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
After
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Changes are limited to Jest snapshot updates reflecting new design-token color values; no functional logic changes are present. Main risk is unintended visual regressions if the updated palette reduces contrast in some states.
Overview
Updates a large set of Jest snapshots across the component library and a few app components to reflect new design-token color values (notably neutral text, border, background, and interaction-state colors).
Most snapshot diffs are palette shifts such as
#121314→#131416,#686e7d→#66676a,#b7bbc8→#949596,#f3f5f9→#f3f3f4, plus updated translucent separators/pressed backgrounds and a changed modal overlay color inApprovalModal.Written by Cursor Bugbot for commit 610c6ed. This will update automatically on new commits. Configure here.