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. |
30bd473 to
f780018
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unresolved git merge conflict markers in test file
- Removed merge conflict markers and properly merged required mocks (safe-area, theme, design system) in RewardsSettingsView.test.tsx.
Or push these changes by commenting:
@cursor push f99d56dea9
Preview (f99d56dea9)
diff --git a/app/components/UI/Rewards/Views/RewardsSettingsView.test.tsx b/app/components/UI/Rewards/Views/RewardsSettingsView.test.tsx
--- a/app/components/UI/Rewards/Views/RewardsSettingsView.test.tsx
+++ b/app/components/UI/Rewards/Views/RewardsSettingsView.test.tsx
@@ -25,13 +25,6 @@
};
});
-<<<<<<< HEAD
-// Mock react-native-safe-area-context (override SafeAreaView only; keep SafeAreaProvider etc. for stack)
-jest.mock('react-native-safe-area-context', () => {
- const React = jest.requireActual('react');
- const { View } = jest.requireActual('react-native');
- const actual = jest.requireActual('react-native-safe-area-context');
-=======
// Mock theme
jest.mock('../../../../util/theme', () => {
const { mockTheme } = jest.requireActual('../../../../util/theme');
@@ -45,11 +38,76 @@
getNavigationOptionsTitle: jest.fn(() => ({ title: 'Settings' })),
}));
-// Mock design system components
+// Mock design system components (minimal set used by header)
jest.mock('@metamask/design-system-react-native', () => {
- const { View, Text } = jest.requireActual('react-native');
->>>>>>> 30bd473975 (test: migrate color-no-hex for rewards codeowner batch)
+ const ReactActual = jest.requireActual('react');
+ const {
+ View,
+ Text: RNText,
+ TouchableOpacity,
+ } = jest.requireActual('react-native');
return {
+ Box: ({
+ children,
+ testID,
+ ...props
+ }: {
+ children?: React.ReactNode;
+ testID?: string;
+ [key: string]: unknown;
+ }) => ReactActual.createElement(View, { testID, ...props }, children),
+ Text: ({
+ children,
+ ...props
+ }: {
+ children?: React.ReactNode;
+ [key: string]: unknown;
+ }) => ReactActual.createElement(RNText, props, children),
+ ButtonIcon: ({
+ onPress,
+ testID,
+ isDisabled,
+ ...props
+ }: {
+ onPress?: () => void;
+ testID?: string;
+ isDisabled?: boolean;
+ [key: string]: unknown;
+ }) =>
+ ReactActual.createElement(TouchableOpacity, {
+ onPress,
+ testID,
+ disabled: isDisabled,
+ ...props,
+ }),
+ // Enums/constants used by components
+ IconName: {
+ ArrowLeft: 'arrow-left',
+ Close: 'close',
+ },
+ ButtonIconSize: {
+ Md: 'md',
+ Lg: 'lg',
+ },
+ TextVariant: {
+ BodyMd: 'BodyMd',
+ BodySm: 'BodySm',
+ },
+ FontWeight: {
+ Bold: 'bold',
+ },
+ BoxAlignItems: {
+ Center: 'center',
+ },
+ };
+});
+
+// Mock react-native-safe-area-context (override SafeAreaView only; keep SafeAreaProvider etc. for stack)
+jest.mock('react-native-safe-area-context', () => {
+ const React = jest.requireActual('react');
+ const { View } = jest.requireActual('react-native');
+ const actual = jest.requireActual('react-native-safe-area-context');
+ return {
...actual,
useSafeAreaInsets: jest.fn(() => ({
top: 0,| <Button size={ButtonSize.Md} onPress={handleIdle}> | ||
| Set random value | ||
| </Button> | ||
| </View> |
There was a problem hiding this comment.
After
after720.mov
c01c82f to
32776a7
Compare
32776a7 to
3a5d5c1
Compare
🔍 Smart E2E Test Selection
click to see 🤖 AI reasoning detailsE2E Test Selection:
No production code is modified in this PR. All changes are confined to:
There are no E2E tests for the Rewards feature, and since no production code is changed, no E2E tests need to run to validate these changes. Performance Test Selection: |
|




Description
This PR is the Rewards-only split of the
color-no-hexbatch work, extracted from the original umbrella PR #26651.Scope:
app/components/UI/Rewards/**)app/components/UI/Rewards/**/*.{js,jsx,ts,tsx}mockThemein a subset of Rewards testsReference PR: #26651
Changelog
CHANGELOG entry: null
Related issues
Fixes:
Manual testing steps
Screenshots/Recordings
Before
N/A (test/lint/config updates only)
After
N/A (test/lint/config updates only)
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Low Risk
Low runtime risk since changes are limited to ESLint configuration plus test/story updates; main risk is CI/dev friction if any remaining Rewards hex literals trigger the newly-enforced lint rule.
Overview
Enforces
@metamask/design-tokens/color-no-hexfor Rewards UI code. Updates.eslintrc.jsto includeapp/components/UI/Rewards/**/*in the folders where hex colors are treated as lint errors.Aligns Rewards tests/stories with the rule. Rewards tests now mock
useThemeby reusing the sharedmockTheme(and remove a local onboardingmockThemehelper), and a Rewards Storybook story (RewardPointsAnimation) is refactored to use Tailwind/design-systemButtons instead of inline styles/hex colors, with a couple of tests explicitly scoping hex-only mock API colors behind lint disables.Written by Cursor Bugbot for commit 3a5d5c1. This will update automatically on new commits. Configure here.