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
1 change: 1 addition & 0 deletions .github/workflows/build-android-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,7 @@ jobs:
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
MM_PREDICT_GTM_MODAL_ENABLED: 'false'

- name: Repack APK with JS updates using @expo/repack-app
if: ${{ steps.apk-cache-restore.outputs.cache-hit == 'true' }}
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/build-ios-e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
GOOGLE_SERVICES_B64_IOS: ${{ secrets.GOOGLE_SERVICES_B64_IOS }}
GOOGLE_SERVICES_B64_ANDROID: ${{ secrets.GOOGLE_SERVICES_B64_ANDROID }}
MM_INFURA_PROJECT_ID: ${{ secrets.MM_INFURA_PROJECT_ID }}
MM_PREDICT_GTM_MODAL_ENABLED: 'false'

steps:
# Get the source code from the repository
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/update-release-changelog.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ jobs:
pull-requests: write
steps:
- name: Update Release Changelog
uses: MetaMask/github-tools/.github/actions/update-release-changelog@v1.1.2
uses: MetaMask/github-tools/.github/actions/update-release-changelog@v1.1.3
with:
release-branch: ${{ github.ref_name }}
repository-url: ${{ github.server_url }}/${{ github.repository }}
platform: mobile
previous-version-ref: 'null'
github-tools-version: v1.1.2
github-tools-version: v1.1.3
github-token: ${{ secrets.PR_TOKEN }}
32 changes: 32 additions & 0 deletions app/components/UI/Card/Views/CardHome/CardHome.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -163,8 +163,13 @@ const mockUseAssetBalances = jest.fn(() =>
}),
);

const mockNavigateToTravelPage = jest.fn();
const mockNavigateToCardTosPage = jest.fn();

const mockUseNavigateToCardPage = jest.fn(() => ({
navigateToCardPage: mockNavigateToCardPage,
navigateToTravelPage: mockNavigateToTravelPage,
navigateToCardTosPage: mockNavigateToCardTosPage,
}));

const mockUseSwapBridgeNavigation = jest.fn(() => ({
Expand Down Expand Up @@ -629,6 +634,8 @@ describe('CardHome Component', () => {

mockUseNavigateToCardPage.mockReturnValue({
navigateToCardPage: mockNavigateToCardPage,
navigateToTravelPage: mockNavigateToTravelPage,
navigateToCardTosPage: mockNavigateToCardTosPage,
});

mockUseSwapBridgeNavigation.mockReturnValue({
Expand Down Expand Up @@ -792,6 +799,31 @@ describe('CardHome Component', () => {
});
});

it('calls navigateToTravelPage when travel item is pressed', async () => {
render();

const travelItem = screen.getByTestId(CardHomeSelectors.TRAVEL_ITEM);
fireEvent.press(travelItem);

await waitFor(() => {
expect(mockNavigateToTravelPage).toHaveBeenCalled();
});
});

it('calls navigateToCardTosPage when TOS item is pressed', async () => {
setupMockSelectors({ isAuthenticated: true });
setupLoadCardDataMock({ isAuthenticated: true });

render();

const tosItem = screen.getByTestId(CardHomeSelectors.CARD_TOS_ITEM);
fireEvent.press(tosItem);

await waitFor(() => {
expect(mockNavigateToCardTosPage).toHaveBeenCalled();
});
});

it('displays correct priority token information', async () => {
// Given: USDC is the priority token
// When: component renders with privacy mode off
Expand Down
35 changes: 28 additions & 7 deletions app/components/UI/Card/Views/CardHome/CardHome.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ const CardHome = () => {

const { provisionCard, isLoading: isLoadingProvisionCard } =
useCardProvision();
const { navigateToCardPage } = useNavigateToCardPage(navigation);
const { navigateToCardPage, navigateToTravelPage, navigateToCardTosPage } =
useNavigateToCardPage(navigation);
const { openSwaps } = useOpenSwaps({
priorityToken,
});
Expand Down Expand Up @@ -992,15 +993,35 @@ const CardHome = () => {
onPress={navigateToCardPage}
testID={CardHomeSelectors.ADVANCED_CARD_MANAGEMENT_ITEM}
/>
<ManageCardListItem
title={strings('card.card_home.manage_card_options.travel_title')}
description={strings(
'card.card_home.manage_card_options.travel_description',
)}
rightIcon={IconName.Export}
onPress={navigateToTravelPage}
testID={CardHomeSelectors.TRAVEL_ITEM}
/>
</View>

{isAuthenticated && (
<ManageCardListItem
title={strings('card.card_home.logout')}
description={strings('card.card_home.logout_description')}
rightIcon={IconName.Logout}
onPress={logoutAction}
/>
<>
<ManageCardListItem
title={strings('card.card_home.manage_card_options.card_tos_title')}
description={strings(
'card.card_home.manage_card_options.card_tos_description',
)}
rightIcon={IconName.Export}
onPress={navigateToCardTosPage}
testID={CardHomeSelectors.CARD_TOS_ITEM}
/>
<ManageCardListItem
title={strings('card.card_home.logout')}
description={strings('card.card_home.logout_description')}
rightIcon={IconName.Logout}
onPress={logoutAction}
/>
</>
)}
</ScrollView>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1167,6 +1167,103 @@ exports[`CardHome Component renders correctly and matches snapshot 1`] = `
</View>
</View>
</TouchableOpacity>
<TouchableOpacity
onPress={[MockFunction]}
testID="travel-item"
>
<View
accessibilityRole="none"
accessible={true}
style={
{
"backgroundColor": "#ffffff",
"padding": 16,
}
}
>
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "flex-start",
"flex": 1,
"flexDirection": "column",
"justifyContent": "space-between",
}
}
testID="listitemcolumn"
>
<Text
accessibilityRole="text"
style={
{
"color": "#121314",
"fontFamily": "Geist Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
}
>
card.card_home.manage_card_options.travel_title
</Text>
<Text
accessibilityRole="text"
style={
{
"color": "#686e7d",
"fontFamily": "Geist Regular",
"fontSize": 14,
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
card.card_home.manage_card_options.travel_description
</Text>
</View>
<View
accessible={false}
style={
{
"width": 16,
}
}
testID="listitem-gap"
/>
<View
style={
{
"flex": -1,
}
}
testID="listitemcolumn"
>
<SvgMock
color="#121314"
fill="currentColor"
height={20}
name="Export"
style={
{
"height": 20,
"paddingLeft": 16,
"width": 20,
}
}
width={20}
/>
</View>
</View>
</View>
</TouchableOpacity>
</View>
</View>
</RCTScrollView>
Expand Down Expand Up @@ -2349,6 +2446,103 @@ exports[`CardHome Component renders correctly with privacy mode enabled 1`] = `
</View>
</View>
</TouchableOpacity>
<TouchableOpacity
onPress={[MockFunction]}
testID="travel-item"
>
<View
accessibilityRole="none"
accessible={true}
style={
{
"backgroundColor": "#ffffff",
"padding": 16,
}
}
>
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
}
}
>
<View
style={
{
"alignItems": "flex-start",
"flex": 1,
"flexDirection": "column",
"justifyContent": "space-between",
}
}
testID="listitemcolumn"
>
<Text
accessibilityRole="text"
style={
{
"color": "#121314",
"fontFamily": "Geist Medium",
"fontSize": 16,
"letterSpacing": 0,
"lineHeight": 24,
}
}
>
card.card_home.manage_card_options.travel_title
</Text>
<Text
accessibilityRole="text"
style={
{
"color": "#686e7d",
"fontFamily": "Geist Regular",
"fontSize": 14,
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
card.card_home.manage_card_options.travel_description
</Text>
</View>
<View
accessible={false}
style={
{
"width": 16,
}
}
testID="listitem-gap"
/>
<View
style={
{
"flex": -1,
}
}
testID="listitemcolumn"
>
<SvgMock
color="#121314"
fill="currentColor"
height={20}
name="Export"
style={
{
"height": 20,
"paddingLeft": 16,
"width": 20,
}
}
width={20}
/>
</View>
</View>
</View>
</TouchableOpacity>
</View>
</View>
</RCTScrollView>
Expand Down
Loading
Loading