Skip to content

Commit 2bc4456

Browse files
committed
Merge branch 'develop' into feat.voip-lib-new
2 parents 9e54a4b + 9d43512 commit 2bc4456

58 files changed

Lines changed: 19178 additions & 737 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.eslintignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,3 +4,5 @@ coverage
44
e2e/docker
55
android
66
ios
7+
8+
.worktrees/

.maestro/tests/assorted/change-avatar.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,14 @@ tags:
9292
- extendedWaitUntil:
9393
visible:
9494
id: 'change-avatar-view-submit'
95-
enabled: false
9695
timeout: 60000
96+
# Before selecting/changing avatar, Save should not proceed
97+
- tapOn:
98+
id: 'change-avatar-view-submit'
99+
- extendedWaitUntil:
100+
visible:
101+
id: 'change-avatar-view-submit'
102+
timeout: 3000
97103
- extendedWaitUntil:
98104
visible:
99105
text: 'Upload image'
@@ -103,7 +109,6 @@ tags:
103109
- extendedWaitUntil:
104110
visible:
105111
id: 'change-avatar-view-submit'
106-
enabled: true
107112
timeout: 60000
108113
- tapOn:
109114
id: 'change-avatar-view-submit'
@@ -125,7 +130,6 @@ tags:
125130
- extendedWaitUntil:
126131
visible:
127132
id: 'change-avatar-view-submit'
128-
enabled: false
129133
timeout: 60000
130134
- extendedWaitUntil:
131135
visible:
@@ -136,7 +140,6 @@ tags:
136140
- extendedWaitUntil:
137141
visible:
138142
id: 'change-avatar-view-submit'
139-
enabled: true
140143
timeout: 60000
141144
- tapOn:
142145
id: 'change-avatar-view-submit'
@@ -158,7 +161,6 @@ tags:
158161
- extendedWaitUntil:
159162
visible:
160163
id: 'change-avatar-view-submit'
161-
enabled: false
162164
timeout: 60000
163165
- extendedWaitUntil:
164166
visible:
@@ -173,11 +175,9 @@ tags:
173175
timeout: 60000
174176
- tapOn:
175177
text: 'Fetch image from URL'
176-
- runFlow: '../../helpers/hide-keyboard.yaml'
177178
- extendedWaitUntil:
178179
visible:
179180
id: 'change-avatar-view-submit'
180-
enabled: true
181181
timeout: 60000
182182
- tapOn:
183183
id: 'change-avatar-view-submit'

.prettierignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ ios/
99
patches/
1010
scripts/
1111

12+
.worktrees/
13+
1214
.bettercodehub.yml
1315
.buckconfig
1416
.gitattributes

android/app/src/main/java/chat/rocket/reactnative/notification/CustomPushNotification.java

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,9 @@ public class CustomPushNotification {
5151
public static final String KEY_REPLY = "KEY_REPLY";
5252
public static final String NOTIFICATION_ID = "NOTIFICATION_ID";
5353
private static final String CHANNEL_ID = "rocketchatrn_channel_01";
54-
private static final String CHANNEL_NAME = "All";
54+
private static final String CHANNEL_NAME = "Messages";
55+
private static final String CALLS_CHANNEL_ID = "rocketchatrn_channel_calls";
56+
private static final String CALLS_CHANNEL_NAME = "Calls";
5557

5658
// Instance fields
5759
private final Context mContext;
@@ -299,13 +301,19 @@ private void postNotification(int notificationId) {
299301

300302
private void createNotificationChannel() {
301303
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
302-
NotificationChannel channel = new NotificationChannel(
304+
NotificationChannel messagesChannel = new NotificationChannel(
303305
CHANNEL_ID,
304306
CHANNEL_NAME,
305307
NotificationManager.IMPORTANCE_HIGH
306308
);
309+
NotificationChannel callsChannel = new NotificationChannel(
310+
CALLS_CHANNEL_ID,
311+
CALLS_CHANNEL_NAME,
312+
NotificationManager.IMPORTANCE_HIGH
313+
);
307314
if (notificationManager != null) {
308-
notificationManager.createNotificationChannel(channel);
315+
notificationManager.createNotificationChannel(messagesChannel);
316+
notificationManager.createNotificationChannel(callsChannel);
309317
}
310318
}
311319
}

app/containers/CustomIcon/selection.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import React, { useRef } from 'react';
2+
import { View } from 'react-native';
3+
4+
import Base, { type IBase } from '.';
5+
import { TYPE } from '../constants';
6+
7+
export default {
8+
title: 'Passcode/Base'
9+
};
10+
11+
const PasscodeBase = ({ ...props }) => {
12+
const ref = useRef<IBase>(null);
13+
return <Base ref={ref} type={TYPE.CHOOSE} title='Create Passcode' onEndProcess={() => {}} {...props} />;
14+
};
15+
16+
export const ChooseType = () => (
17+
<View style={{ flex: 1 }}>
18+
<PasscodeBase type={TYPE.CHOOSE} title='Create Passcode' />
19+
</View>
20+
);
21+
22+
export const ConfirmType = () => (
23+
<View style={{ flex: 1 }}>
24+
<PasscodeBase type={TYPE.CONFIRM} title='Confirm Passcode' previousPasscode='123456' onError={() => {}} />
25+
</View>
26+
);
27+
28+
export const EnterType = () => (
29+
<View style={{ flex: 1 }}>
30+
<PasscodeBase type={TYPE.ENTER} title='Enter Passcode' />
31+
</View>
32+
);
33+
34+
export const WithSubtitle = () => (
35+
<View style={{ flex: 1 }}>
36+
<PasscodeBase type={TYPE.CHOOSE} title='Create Passcode' subtitle='This passcode will protect your data' />
37+
</View>
38+
);
39+
40+
export const WithBiometry = () => (
41+
<View style={{ flex: 1 }}>
42+
<PasscodeBase type={TYPE.ENTER} title='Enter Passcode' showBiometry onBiometryPress={() => {}} />
43+
</View>
44+
);
45+
46+
export const EnterWithSubtitleAndBiometry = () => (
47+
<View style={{ flex: 1 }}>
48+
<PasscodeBase
49+
type={TYPE.ENTER}
50+
title='Unlock App'
51+
subtitle='Authentication required'
52+
showBiometry
53+
onBiometryPress={() => {}}
54+
/>
55+
</View>
56+
);
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
import React, { createRef } from 'react';
2+
import { render } from '@testing-library/react-native';
3+
4+
import { generateSnapshots } from '../../../../.rnstorybook/generateSnapshots';
5+
import Base, { type IBase } from '.';
6+
import { TYPE } from '../constants';
7+
import * as stories from './Base.stories';
8+
9+
const onEndProcessMock = jest.fn();
10+
11+
const TestBase = ({ ...props }) => {
12+
const ref = createRef<IBase>();
13+
return <Base ref={ref} type={TYPE.ENTER} title='Test Title' onEndProcess={onEndProcessMock} {...props} />;
14+
};
15+
16+
describe('Base Passcode Component', () => {
17+
beforeEach(() => {
18+
onEndProcessMock.mockClear();
19+
});
20+
21+
test('should render with title', () => {
22+
const { getByText } = render(<TestBase title='Enter Passcode' />);
23+
expect(getByText('Enter Passcode')).toBeTruthy();
24+
});
25+
26+
test('should render with subtitle when provided', () => {
27+
const { getByText } = render(<TestBase title='Enter Passcode' subtitle='Authentication required' />);
28+
expect(getByText('Authentication required')).toBeTruthy();
29+
});
30+
31+
test('should not render subtitle when not provided', () => {
32+
const { queryByText } = render(<TestBase title='Enter Passcode' />);
33+
expect(queryByText('Authentication required')).toBeNull();
34+
});
35+
36+
test('should expose ref methods', () => {
37+
const ref = createRef<IBase>();
38+
render(<Base ref={ref} type={TYPE.ENTER} title='Enter Passcode' onEndProcess={onEndProcessMock} />);
39+
expect(ref.current?.clearPasscode).toBeDefined();
40+
expect(ref.current?.wrongPasscode).toBeDefined();
41+
expect(ref.current?.animate).toBeDefined();
42+
});
43+
44+
test('should render biometry button when showBiometry is true', () => {
45+
const { getByTestId } = render(<TestBase type={TYPE.ENTER} title='Enter Passcode' showBiometry onBiometryPress={() => {}} />);
46+
expect(getByTestId('biometry-button')).toBeTruthy();
47+
});
48+
49+
test('should render all passcode buttons with testIDs', () => {
50+
const { getByTestId } = render(<TestBase type={TYPE.ENTER} title='Enter Passcode' />);
51+
// Number buttons 0-9
52+
for (let i = 0; i <= 9; i++) {
53+
expect(getByTestId(`passcode-button-${i}`)).toBeTruthy();
54+
}
55+
// backspace button
56+
expect(getByTestId('passcode-button-backspace')).toBeTruthy();
57+
});
58+
});
59+
60+
generateSnapshots(stories);

app/containers/Passcode/Base/Button.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,17 @@ interface IPasscodeButton {
1212
disabled?: boolean;
1313
onPress?: Function;
1414
style?: StyleProp<ViewStyle>;
15+
testID?: string;
1516
}
1617

17-
const Button = React.memo(({ style, text, disabled, onPress, icon }: IPasscodeButton) => {
18+
const Button = React.memo(({ style, text, disabled, onPress, icon, testID }: IPasscodeButton) => {
1819
const { colors } = useTheme();
1920

2021
const press = () => onPress && onPress(text);
2122

2223
return (
2324
<Touch
25+
testID={testID}
2426
style={[styles.buttonView, { backgroundColor: 'transparent' }, style]}
2527
underlayColor={colors.buttonBackgroundSecondaryDefault}
2628
rippleColor={colors.buttonBackgroundSecondaryPress}

0 commit comments

Comments
 (0)