Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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')),
Expand Down Expand Up @@ -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', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down Expand Up @@ -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', () => {
Expand Down
Loading