Skip to content

Commit

Permalink
Merge pull request #614 from juanky201271/dev_pin_based_and_address_b…
Browse files Browse the repository at this point in the history
…ook_texts_changes

Some minor fixes for the next release
  • Loading branch information
juanky201271 authored Mar 15, 2024
2 parents 7c321a3 + e430237 commit 58c1cd2
Show file tree
Hide file tree
Showing 56 changed files with 1,782 additions and 304 deletions.
2 changes: 1 addition & 1 deletion App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const basicTheme: ThemeType = {
card: '#011401',
border: '#ffffff',
primary: '#0ef8f8', // new tron color
primaryDisabled: '#addcdc', // new tron color disable
primaryDisabled: '#a0dcdc', // new tron color disable
secondaryDisabled: '#233623',
text: '#c3c3c3',
zingo: '#888888',
Expand Down
4 changes: 4 additions & 0 deletions __tests__/History.TxDetail.unit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,10 @@ jest.mock('moment', () => {
jest.mock('moment/locale/es', () => () => ({
defineLocale: jest.fn(),
}));
jest.mock('moment/locale/pt', () => () => ({
defineLocale: jest.fn(),
}));

jest.mock('react-native-gesture-handler', () => {
const View = require('react-native').View;
return {
Expand Down
4 changes: 4 additions & 0 deletions __tests__/History.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ jest.mock('moment', () => {
jest.mock('moment/locale/es', () => () => ({
defineLocale: jest.fn(),
}));
jest.mock('moment/locale/pt', () => () => ({
defineLocale: jest.fn(),
}));

jest.mock('react-native-gesture-handler', () => {
const View = require('react-native').View;
return {
Expand Down
69 changes: 69 additions & 0 deletions __tests__/Memo.snapshot.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
/**
* @format
*/

import 'react-native';
import React from 'react';

import { render } from '@testing-library/react-native';
import Memo from '../components/Memo';
import { defaultAppStateLoaded, ContextAppLoadedProvider } from '../app/context';

jest.useFakeTimers();
jest.mock('@fortawesome/react-native-fontawesome', () => ({
FontAwesomeIcon: '',
}));
jest.mock('react-native-localize', () => ({
getNumberFormatSettings: () => {
return {
decimalSeparator: '.',
groupingSeparator: ',',
};
},
}));
jest.mock('react-native/Libraries/Animated/NativeAnimatedHelper');
jest.mock('react-native-reanimated', () => {
return class Reanimated {
public static Value() {
return jest.fn(() => {});
}
public static View() {
return '';
}
};
});
jest.mock('@react-native-community/netinfo', () => {
const RN = jest.requireActual('react-native');

RN.NativeModules.RNCNetInfo = {
execute: jest.fn(() => '{}'),
};

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

RN.NativeModules.RPCModule = {
execute: jest.fn(() => '{}'),
};

return RN;
});

// test suite
describe('Component Memo - test', () => {
//snapshot test
test('Memo - snapshot', () => {
const state = defaultAppStateLoaded;
state.translate = () => 'translated text';
state.sendPageState.toaddr.memo = 'memo1\nmemo2\nmemo3\nmemo4\nmemo5\nmemo6\nmemo7\nmemo8\nmemo9\nmemo10';
const onClose = jest.fn();
const memo = render(
<ContextAppLoadedProvider value={state}>
<Memo closeModal={onClose} updateToField={onClose} />
</ContextAppLoadedProvider>,
);
expect(memo.toJSON()).toMatchSnapshot();
});
});
4 changes: 4 additions & 0 deletions __tests__/Settings.snapshot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ describe('Component Settings - test', () => {
value: 'es',
text: 'text es',
},
{
value: 'pt',
text: 'text pt',
},
];
}
if (p === 'settings.sendalls') {
Expand Down
1 change: 1 addition & 0 deletions __tests__/__snapshots__/ImportUfvk.snapshot.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ exports[`Component ImportUfvk - test ImportUfvk - snapshot 1`] = `
"fontWeight": "600",
"marginHorizontal": 5,
"minHeight": 100,
"textAlignVertical": "top",
}
}
value=""
Expand Down
209 changes: 209 additions & 0 deletions __tests__/__snapshots__/Memo.snapshot.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,209 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Component Memo - test Memo - snapshot 1`] = `
<RCTSafeAreaView
style={
{
"alignItems": "stretch",
"backgroundColor": "rgb(242, 242, 242)",
"display": "flex",
"height": "100%",
"justifyContent": "flex-start",
}
}
>
<RCTScrollView
contentContainerStyle={
{
"alignItems": "stretch",
"flexDirection": "column",
"justifyContent": "flex-start",
"padding": 20,
}
}
style={
{
"maxHeight": "70%",
"minHeight": "70%",
}
}
>
<View>
<View
accessibilityLabel="translated text"
accessible={true}
style={
{
"borderColor": "rgb(28, 28, 30)",
"borderRadius": 5,
"borderWidth": 1,
"flexGrow": 1,
"maxHeight": 667,
"minHeight": 667,
"minWidth": 48,
}
}
>
<TextInput
editable={true}
multiline={true}
onChangeText={[Function]}
style={
{
"backgroundColor": "transparent",
"color": "rgb(28, 28, 30)",
"flex": 1,
"fontSize": 14,
"fontWeight": "600",
"margin": 5,
"minHeight": 48,
"minWidth": 48,
"textAlignVertical": "top",
}
}
testID="send.memo-field"
value="memo1
memo2
memo3
memo4
memo5
memo6
memo7
memo8
memo9
memo10"
/>
</View>
</View>
</RCTScrollView>
<View
style={
{
"alignItems": "center",
"flexDirection": "row",
"flexGrow": 1,
"justifyContent": "center",
"marginVertical": 5,
}
}
>
<View
accessible={true}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
{
"alignItems": "center",
"backgroundColor": "rgb(0, 122, 255)",
"borderColor": "rgb(28, 28, 30)",
"borderRadius": 10,
"borderWidth": 2,
"justifyContent": "center",
"maxWidth": "90%",
"minHeight": 48,
"minWidth": "30%",
"opacity": 1,
"padding": 0,
"paddingLeft": 20,
"paddingRight": 20,
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"margin": 0,
"minHeight": 48,
"minWidth": 48,
"padding": 0,
}
}
>
<Text
style={
{
"color": "rgb(242, 242, 242)",
"fontSize": 16,
"fontWeight": "bold",
"textAlign": "center",
"textTransform": "uppercase",
}
}
>
translated text
</Text>
</View>
</View>
<View
accessible={true}
collapsable={false}
focusable={true}
onClick={[Function]}
onResponderGrant={[Function]}
onResponderMove={[Function]}
onResponderRelease={[Function]}
onResponderTerminate={[Function]}
onResponderTerminationRequest={[Function]}
onStartShouldSetResponder={[Function]}
style={
{
"alignItems": "center",
"backgroundColor": "rgb(242, 242, 242)",
"borderColor": "rgb(0, 122, 255)",
"borderRadius": 10,
"borderWidth": 2,
"justifyContent": "center",
"marginLeft": 10,
"maxWidth": "90%",
"minHeight": 48,
"minWidth": "30%",
"opacity": 1,
"padding": 0,
"paddingLeft": 20,
"paddingRight": 20,
}
}
>
<View
style={
{
"alignItems": "center",
"display": "flex",
"flexDirection": "row",
"justifyContent": "center",
"margin": 0,
"minHeight": 48,
"minWidth": 48,
"padding": 0,
}
}
>
<Text
style={
{
"color": "rgb(0, 122, 255)",
"fontSize": 16,
"fontWeight": "bold",
"textAlign": "center",
"textTransform": "uppercase",
}
}
>
translated text
</Text>
</View>
</View>
</View>
</RCTSafeAreaView>
`;
1 change: 1 addition & 0 deletions __tests__/__snapshots__/Seed.snapshot.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1017,6 +1017,7 @@ exports[`Component Seed - test Seed Restore - snapshot 1`] = `
"marginLeft": 5,
"minHeight": 100,
"minWidth": "95%",
"textAlignVertical": "top",
}
}
testID="seed.seedinput"
Expand Down
14 changes: 14 additions & 0 deletions __tests__/__snapshots__/Send.snapshot.tsx.snap
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ exports[`Component Send - test Send currency USD, privacy high & mode advanced -
transparent={false}
visible={false}
/>
<Modal
animationType="slide"
hardwareAccelerated={false}
onRequestClose={[Function]}
transparent={false}
visible={false}
/>
<RCTScrollView
contentContainerStyle={{}}
keyboardShouldPersistTaps="handled"
Expand Down Expand Up @@ -967,6 +974,13 @@ exports[`Component Send - test Send no currency, privacy normal & mode basic - s
transparent={false}
visible={false}
/>
<Modal
animationType="slide"
hardwareAccelerated={false}
onRequestClose={[Function]}
transparent={false}
visible={false}
/>
<RCTScrollView
contentContainerStyle={{}}
keyboardShouldPersistTaps="handled"
Expand Down
Loading

0 comments on commit 58c1cd2

Please sign in to comment.