From bf3f25e69a90c7cf9eaa06e9c32e3bec55c61f75 Mon Sep 17 00:00:00 2001 From: Racitores Date: Fri, 30 Jan 2026 11:22:52 +0100 Subject: [PATCH 1/2] fix: test --- ...sdConversionAssetOverviewCta.view.test.tsx | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/app/components/UI/Earn/components/Musd/MusdConversionAssetOverviewCta/MusdConversionAssetOverviewCta.view.test.tsx b/app/components/UI/Earn/components/Musd/MusdConversionAssetOverviewCta/MusdConversionAssetOverviewCta.view.test.tsx index f2623586d561..67223f1a31f4 100644 --- a/app/components/UI/Earn/components/Musd/MusdConversionAssetOverviewCta/MusdConversionAssetOverviewCta.view.test.tsx +++ b/app/components/UI/Earn/components/Musd/MusdConversionAssetOverviewCta/MusdConversionAssetOverviewCta.view.test.tsx @@ -6,6 +6,7 @@ import React from 'react'; import { View } from 'react-native'; import MusdConversionAssetOverviewCta from './index'; import { EARN_TEST_IDS } from '../../../constants/testIds'; +import { MUSD_CONVERSION_APY } from '../../../constants/musd'; import { fireEvent } from '@testing-library/react-native'; import { TokenI } from '../../../../Tokens/types'; @@ -97,11 +98,14 @@ describeForPlatforms('MusdConversionAssetOverviewCta', () => { ); // Assert - expect(getByText('Boost your stablecoin balance')).toBeOnTheScreen(); expect( - getByText(/Earn a bonus every time you convert stablecoins to/), + getByText(`Get ${MUSD_CONVERSION_APY}% on your stablecoins`), + ).toBeOnTheScreen(); + expect( + getByText( + `Convert your stablecoins to mUSD and receive up to a ${MUSD_CONVERSION_APY}% bonus.`, + ), ).toBeOnTheScreen(); - expect(getByText('mUSD')).toBeOnTheScreen(); }); it('renders close button when onDismiss is provided', () => { @@ -498,7 +502,9 @@ describeForPlatforms('MusdConversionAssetOverviewCta', () => { ); // Assert - expect(getByText('Boost your stablecoin balance')).toBeOnTheScreen(); + expect( + getByText(`Get ${MUSD_CONVERSION_APY}% on your stablecoins`), + ).toBeOnTheScreen(); }); it('renders CTA with correct boost description text', () => { @@ -530,9 +536,10 @@ describeForPlatforms('MusdConversionAssetOverviewCta', () => { // Assert expect( - getByText(/Earn a bonus every time you convert stablecoins to/), + getByText( + `Convert your stablecoins to mUSD and receive up to a ${MUSD_CONVERSION_APY}% bonus.`, + ), ).toBeOnTheScreen(); - expect(getByText('mUSD')).toBeOnTheScreen(); }); it('renders CTA for USDT asset when in allowlist', () => { From 03c42f64200e198ddfaed43d1f674f0a156d63a3 Mon Sep 17 00:00:00 2001 From: Racitores Date: Fri, 30 Jan 2026 11:36:04 +0100 Subject: [PATCH 2/2] fix: EarnMusdConversionEducationView view tests - use regex for description text --- .../EarnMusdConversionEducationView.view.test.tsx | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/app/components/UI/Earn/Views/EarnMusdConversionEducationView/EarnMusdConversionEducationView.view.test.tsx b/app/components/UI/Earn/Views/EarnMusdConversionEducationView/EarnMusdConversionEducationView.view.test.tsx index 2e97d4979d27..876187c9c6aa 100644 --- a/app/components/UI/Earn/Views/EarnMusdConversionEducationView/EarnMusdConversionEducationView.view.test.tsx +++ b/app/components/UI/Earn/Views/EarnMusdConversionEducationView/EarnMusdConversionEducationView.view.test.tsx @@ -57,11 +57,7 @@ describeForPlatforms('EarnMusdConversionEducationView', () => { ), ).toBeOnTheScreen(); expect( - getByText( - strings('earn.musd_conversion.education.description', { - percentage: MUSD_CONVERSION_APY, - }), - ), + getByText(/Convert your stablecoins to mUSD.*receive up to a \d+% bonus/), ).toBeOnTheScreen(); expect( getByText(strings('earn.musd_conversion.education.primary_button')), @@ -393,12 +389,10 @@ describeForPlatforms('EarnMusdConversionEducationView', () => { // Assert const description = getByText( - strings('earn.musd_conversion.education.description', { - percentage: MUSD_CONVERSION_APY, - }), + /Convert your stablecoins to mUSD.*receive up to a \d+% bonus/, ); expect(description).toBeOnTheScreen(); - expect(description.props.children).toContain(`${MUSD_CONVERSION_APY}%`); + expect(description.props.children[0]).toContain(`${MUSD_CONVERSION_APY}%`); }); it('renders education screen when education has been seen', () => {