Skip to content

Commit

Permalink
Merge pull request #777 from dorianvp/bump_rn_0.75.5
Browse files Browse the repository at this point in the history
Bump `react-native` to 0.75.5
  • Loading branch information
juanky201271 authored Feb 18, 2025
2 parents cb051cd + ee09834 commit 38fa32f
Show file tree
Hide file tree
Showing 147 changed files with 8,510 additions and 8,125 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/android-macos-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -152,9 +152,9 @@ jobs:
run: echo "${ANDROID_SDK_ROOT}/emulator" >> $GITHUB_PATH

- name: Gradle cache
uses: gradle/actions/setup-gradle@v3
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.2
gradle-version: 8.8
build-root-directory: ./android
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-ubuntu-e2e-test-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ jobs:
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.2
gradle-version: 8.8
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}}

- name: Native rust cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/android-ubuntu-integration-test-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ jobs:
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.2
gradle-version: 8.8
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}}

- name: Native rust cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/old/android-e2e-test-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.2
gradle-version: 8.8
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev'}}

- name: Native rust cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/old/android-e2e-test-script.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ jobs:
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.2
gradle-version: 8.8
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}

- name: AVD cache
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/old/android-ubuntu-integration-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ jobs:
- name: Gradle cache
uses: gradle/actions/setup-gradle@v4
with:
gradle-version: 8.2
gradle-version: 8.8
cache-read-only: ${{ github.ref != 'refs/heads/main' && github.ref != 'refs/heads/dev' }}

- name: AVD cache
Expand Down
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,6 @@ buck-out/
/**/GoogleService-Info.plist

# Binaries
/rust/test_binaries/bins/
/rust/test_binaries/bins/

.cxx
44 changes: 23 additions & 21 deletions App.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* eslint-disable react-native/no-inline-styles */
import React, { useState } from 'react';
import { SafeAreaView } from 'react-native';
import { NavigationContainer } from '@react-navigation/native';
import { SafeAreaProvider, SafeAreaView } from 'react-native-safe-area-context';
import { DefaultTheme, NavigationContainer } from '@react-navigation/native';
import { createStackNavigator } from '@react-navigation/stack';

import { LoadedApp } from './app/LoadedApp';
Expand Down Expand Up @@ -42,6 +42,7 @@ const basicPalette: string[] = [
];

const advancedTheme: ThemeType = {
...DefaultTheme,
dark: true,
colors: {
background: advancePalette[0],
Expand All @@ -61,6 +62,7 @@ const advancedTheme: ThemeType = {
};

const basicTheme: ThemeType = {
...DefaultTheme,
dark: true,
colors: {
background: basicPalette[0],
Expand Down Expand Up @@ -90,25 +92,25 @@ const App: React.FunctionComponent = () => {

//console.log('render App - 1');
return (
<NavigationContainer theme={theme}>
<SafeAreaView
style={{
flex: 1,
justifyContent: 'center',
backgroundColor: theme.colors.card,
}}>
<Stack.Navigator
initialRouteName={RouteEnums.LoadingApp}
screenOptions={{ headerShown: false, animationEnabled: false }}>
<Stack.Screen name={RouteEnums.LoadingApp}>
{props => <LoadingApp {...props} toggleTheme={toggleTheme} />}
</Stack.Screen>
<Stack.Screen name={RouteEnums.LoadedApp}>
{props => <LoadedApp {...props} toggleTheme={toggleTheme} />}
</Stack.Screen>
</Stack.Navigator>
</SafeAreaView>
</NavigationContainer>
<SafeAreaProvider>
<NavigationContainer theme={theme}>
<SafeAreaView
style={{
flex: 1,
justifyContent: 'center',
backgroundColor: theme.colors.card,
}}>
<Stack.Navigator initialRouteName={RouteEnums.LoadingApp} screenOptions={{ headerShown: false }}>
<Stack.Screen name={RouteEnums.LoadingApp}>
{props => <LoadingApp {...props} toggleTheme={toggleTheme} />}
</Stack.Screen>
<Stack.Screen name={RouteEnums.LoadedApp}>
{props => <LoadedApp {...props} toggleTheme={toggleTheme} />}
</Stack.Screen>
</Stack.Navigator>
</SafeAreaView>
</NavigationContainer>
</SafeAreaProvider>
);
};

Expand Down
9 changes: 5 additions & 4 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ source 'https://rubygems.org'
# You may use http://rbenv.org/ or https://rvm.io/ to install and use this version
ruby ">= 2.6.10"

# Cocoapods 1.15 introduced a bug which break the build. We will remove the upper
# bound in the template on Cocoapods with next React Native release.
gem 'cocoapods', '>= 1.13', '< 1.15'
gem 'activesupport', '>= 6.1.7.5', '< 7.1.0'
# Exclude problematic versions of cocoapods and activesupport that causes build failures.
gem 'cocoapods', '>= 1.13', '!= 1.15.0', '!= 1.15.1'
gem 'activesupport', '>= 6.1.7.5', '!= 7.1.0'
gem 'xcodeproj', '< 1.26.0'
gem 'concurrent-ruby', '< 1.3.4'
4 changes: 4 additions & 0 deletions __mocks__/dataMocks/mockNavigation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,9 @@ export const mockNavigation: StackScreenProps<any>['navigation'] = {
push: jest.fn(),
pop: jest.fn(),
popToTop: jest.fn(),
popTo: jest.fn(),
preload: jest.fn(),
setStateForNextRouteNamesChange: jest.fn(),
navigateDeprecated: jest.fn(),
// Agrega cualquier otra propiedad o método necesario para tu caso
};
2 changes: 1 addition & 1 deletion __mocks__/dataMocks/mockNetInfo.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NetInfoStateType } from '@react-native-community/netinfo';
import { NetInfoStateType } from '@react-native-community/netinfo/src/index';
import { NetInfoType } from '../../app/AppState';

export const mockNetInfo: NetInfoType = {
Expand Down
2 changes: 2 additions & 0 deletions __mocks__/dataMocks/mockTheme.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { DefaultTheme } from '@react-navigation/native';
import { ThemeType } from '../../app/types';

export const mockTheme: ThemeType = {
...DefaultTheme,
dark: true,
colors: {
background: '#011401', //'#010101',
Expand Down
Empty file.
12 changes: 11 additions & 1 deletion __tests__/About.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import { ContextAppLoadedProvider, defaultAppContextLoaded } from '../app/contex
import { mockInfo } from '../__mocks__/dataMocks/mockInfo';
import { mockTotalBalance } from '../__mocks__/dataMocks/mockTotalBalance';
import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate';
import { mockTheme } from '../__mocks__/dataMocks/mockTheme';

jest.mock('react-native-safe-area-context', () => ({
SafeAreaProvider: ({ children }: any) => children,
SafeAreaView: ({ children }: any) => children,
useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }),
}));
jest.useFakeTimers();
jest.mock('@fortawesome/react-native-fontawesome', () => ({
FontAwesomeIcon: '',
Expand All @@ -25,7 +31,7 @@ jest.mock('react-native-localize', () => ({
},
}));
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('@react-native-community/netinfo', () => {
jest.mock('@react-native-community/netinfo/src/index', () => {
const RN = jest.requireActual('react-native');

RN.NativeModules.RNCNetInfo = {
Expand All @@ -47,6 +53,10 @@ jest.mock('@react-native-clipboard/clipboard', () => ({
getString: jest.fn(() => Promise.resolve('mocked clipboard content')),
setString: jest.fn(),
}));
jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useTheme: () => (mockTheme),
}));

// test suite
describe('Component About - test', () => {
Expand Down
8 changes: 7 additions & 1 deletion __tests__/AddressBook.AbDetail.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate';
import { mockAddressBook } from '../__mocks__/dataMocks/mockAddressBook';
import { mockTheme } from '../__mocks__/dataMocks/mockTheme';

jest.mock('react-native-safe-area-context', () => ({
SafeAreaProvider: ({ children }: any) => children,
SafeAreaView: ({ children }: any) => children,
useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }),
}));
jest.useFakeTimers();
jest.mock('@fortawesome/react-native-fontawesome', () => ({
FontAwesomeIcon: '',
Expand All @@ -26,7 +31,7 @@ jest.mock('react-native-localize', () => ({
},
}));
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('@react-native-community/netinfo', () => {
jest.mock('@react-native-community/netinfo/src/index', () => {
const RN = jest.requireActual('react-native');

RN.NativeModules.RNCNetInfo = {
Expand All @@ -45,6 +50,7 @@ jest.mock('react-native', () => {
return RN;
});
jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useScrollToTop: jest.fn(),
useTheme: () => mockTheme,
}));
Expand Down
8 changes: 7 additions & 1 deletion __tests__/AddressBook.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ import { mockAddressBook } from '../__mocks__/dataMocks/mockAddressBook';
import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate';
import { mockTheme } from '../__mocks__/dataMocks/mockTheme';

jest.mock('react-native-safe-area-context', () => ({
SafeAreaProvider: ({ children }: any) => children,
SafeAreaView: ({ children }: any) => children,
useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }),
}));
jest.useFakeTimers();
jest.mock('@fortawesome/react-native-fontawesome', () => ({
FontAwesomeIcon: '',
Expand All @@ -25,7 +30,7 @@ jest.mock('react-native-localize', () => ({
},
}));
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('@react-native-community/netinfo', () => {
jest.mock('@react-native-community/netinfo/src/index', () => {
const RN = jest.requireActual('react-native');

RN.NativeModules.RNCNetInfo = {
Expand All @@ -44,6 +49,7 @@ jest.mock('react-native', () => {
return RN;
});
jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useScrollToTop: jest.fn(),
useTheme: () => mockTheme,
}));
Expand Down
41 changes: 40 additions & 1 deletion __tests__/App.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ import React from 'react';
import { render } from '@testing-library/react-native';
import App from '../App';

jest.mock('react-native-safe-area-context', () => ({
SafeAreaProvider: ({ children }: any) => children,
SafeAreaView: ({ children }: any) => children,
useSafeAreaInsets: () => ({ top: 0, left: 0, right: 0, bottom: 0 }),
}));
jest.useFakeTimers();
jest.mock('@fortawesome/react-native-fontawesome', () => ({
FontAwesomeIcon: '',
Expand All @@ -26,7 +31,7 @@ jest.mock('react-native-tab-view', () => ({
}));
jest.mock('react-native-option-menu', () => '');
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('@react-native-community/netinfo', () => {
jest.mock('@react-native-community/netinfo/src/index', () => {
const RN = jest.requireActual('react-native');

RN.NativeModules.RNCNetInfo = {
Expand All @@ -52,6 +57,37 @@ jest.mock('react-native-device-info', () => ({
getManufacturer: jest.fn(() => 'Mocked Manufacturer'),
getModel: jest.fn(() => 'Mocked Model'),
}));
// Jest setup file or in your test file
jest.mock('react-native-gesture-handler/ReanimatedDrawerLayout', () => {
const R = require('react');

const ReanimatedDrawerLayout = R.forwardRef((props: any, ref: any) => {
const { renderNavigationView, children } = props;

return (
<div ref={ref}>
<div>
{renderNavigationView && renderNavigationView()}
</div>
<div>{children}</div>
</div>
);
});

// Export mock DrawerType if needed
const DrawerType = {
FRONT: 'front',
BACK: 'back',
SLIDE: 'slide',
};

return {
__esModule: true,
default: ReanimatedDrawerLayout,
DrawerType,
};
});

jest.mock('react-native-gesture-handler', () => {
const RN = jest.requireActual('react-native');

Expand Down Expand Up @@ -97,6 +133,9 @@ jest.mock('@react-native-clipboard/clipboard', () => ({
getString: jest.fn(() => Promise.resolve('mocked clipboard content')),
setString: jest.fn(),
}));
jest.mock('@react-navigation/elements', () => ({
PlatformPressable: jest.fn().mockImplementation(({ children }) => children),
}));

// test suite
describe('Component App - test', () => {
Expand Down
6 changes: 6 additions & 0 deletions __tests__/Button.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@ import React from 'react';
import { render } from '@testing-library/react-native';
import Button from '../components/Components/Button';
import { ButtonTypeEnum } from '../app/AppState';
import { mockTheme } from '../__mocks__/dataMocks/mockTheme';

jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useTheme: () => (mockTheme),
}));

// test suite
describe('Component Button - test', () => {
Expand Down
5 changes: 5 additions & 0 deletions __tests__/ChainTypeToggle.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@ import { render } from '@testing-library/react-native';
import ChainTypeToggle from '../components/Components/ChainTypeToggle';
import { ChainNameEnum } from '../app/AppState';
import { mockTranslate } from '../__mocks__/dataMocks/mockTranslate';
import { mockTheme } from '../__mocks__/dataMocks/mockTheme';

jest.useFakeTimers();
jest.mock('@fortawesome/react-native-fontawesome', () => ({
FontAwesomeIcon: '',
}));
jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useTheme: () => (mockTheme),
}));

// test suite
describe('Component ChainTypeToggle - test', () => {
Expand Down
6 changes: 6 additions & 0 deletions __tests__/CircularProgress.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ import React from 'react';

import { render } from '@testing-library/react-native';
import CircularProgress from '../components/Components/CircularProgress';
import { mockTheme } from '../__mocks__/dataMocks/mockTheme';

jest.mock('@react-navigation/native', () => ({
...jest.requireActual('@react-navigation/native'),
useTheme: () => (mockTheme),
}));

// test suite
describe('Component CircularProgress - test', () => {
Expand Down
Loading

0 comments on commit 38fa32f

Please sign in to comment.