Skip to content

Commit cd55159

Browse files
committed
Merge branch 'retry-failed-tests' of https://github.com/RocketChat/Rocket.Chat.ReactNative into retry-failed-tests
2 parents 2bae139 + bfcd597 commit cd55159

File tree

75 files changed

+467
-359
lines changed

Some content is hidden

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

75 files changed

+467
-359
lines changed

.maestro/tests/e2ee/utils/navigate-to-e2ee-security.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,5 +50,3 @@ tags:
5050
visible:
5151
id: e2e-encryption-security-view
5252
timeout: 60000
53-
- assertVisible:
54-
id: e2e-encryption-security-view-reset-password-button

.maestro/tests/e2ee/utils/reset-e2ee-key.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ tags:
1111
timeout: 30000
1212
- extendedWaitUntil:
1313
visible:
14-
id: e2e-encryption-security-view-reset-password-button
14+
id: e2e-encryption-security-view-reset-key
1515
timeout: 60000
1616
- tapOn:
17-
id: e2e-encryption-security-view-reset-password-button
17+
id: e2e-encryption-security-view-reset-key
1818
- extendedWaitUntil:
1919
visible:
2020
text: .*Are you sure.*

.maestro/tests/room/mark-as-unread.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ tags:
5353
timeout: 60000
5454
- extendedWaitUntil:
5555
visible:
56-
text: '.*1.*'
56+
id: 'unread-badge-1'
5757
childOf:
5858
id: 'rooms-list-view-item-${output.otherUser.username}'
5959
timeout: 60000

.maestro/tests/room/search.yaml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
appId: chat.rocket.reactnative
2+
name: Search
3+
onFlowStart:
4+
- runFlow: '../../helpers/setup.yaml'
5+
tags:
6+
- test-13
7+
- android-only
8+
9+
---
10+
- evalScript: ${output.user = output.utils.createUser()}
11+
12+
- runFlow:
13+
file: '../../helpers/login-with-deeplink.yaml'
14+
env:
15+
USERNAME: ${output.user.username}
16+
PASSWORD: ${output.user.password}
17+
18+
- extendedWaitUntil:
19+
visible:
20+
id: 'rooms-list-view-search'
21+
timeout: 60000
22+
- tapOn:
23+
id: rooms-list-view-search
24+
- extendedWaitUntil:
25+
visible:
26+
id: 'rooms-list-view'
27+
timeout: 60000
28+
- extendedWaitUntil:
29+
visible:
30+
id: 'rooms-list-view-search-input'
31+
timeout: 60000
32+
- pressKey: Back
33+
- pressKey: Back
34+
- extendedWaitUntil:
35+
visible:
36+
id: 'rooms-list-view'
37+
timeout: 60000
38+
- extendedWaitUntil:
39+
notVisible:
40+
id: 'rooms-list-view-search-input'
41+
timeout: 60000
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
appId: chat.rocket.reactnative
2+
name: Unread badge
3+
onFlowStart:
4+
- runFlow: '../../helpers/setup.yaml'
5+
tags:
6+
- test-13
7+
8+
---
9+
- evalScript: ${output.user = output.utils.createUser()}
10+
- evalScript: ${output.otherUser = output.utils.createUser()}
11+
12+
- runFlow:
13+
file: '../../helpers/login-with-deeplink.yaml'
14+
env:
15+
USERNAME: ${output.user.username}
16+
PASSWORD: ${output.user.password}
17+
18+
# Should have normal unread indicator on normal message
19+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
20+
- extendedWaitUntil:
21+
visible:
22+
id: 'rooms-list-view-item-${output.otherUser.username}'
23+
timeout: 60000
24+
- extendedWaitUntil:
25+
visible:
26+
id: 'unread-badge-1'
27+
childOf:
28+
id: 'rooms-list-view-item-${output.otherUser.username}'
29+
timeout: 60000
30+
- tapOn:
31+
id: 'rooms-list-view-item-${output.otherUser.username}'
32+
- tapOn:
33+
id: header-back
34+
- extendedWaitUntil:
35+
notVisible:
36+
id: 'unread-badge-1'
37+
childOf:
38+
id: 'rooms-list-view-item-${output.otherUser.username}'
39+
timeout: 60000
40+
41+
# Should have mention unread indicator on mentioned message
42+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
43+
- extendedWaitUntil:
44+
visible:
45+
id: 'rooms-list-view-item-${output.otherUser.username}'
46+
timeout: 60000
47+
- extendedWaitUntil:
48+
visible:
49+
id: 'mention-badge-1'
50+
childOf:
51+
id: 'rooms-list-view-item-${output.otherUser.username}'
52+
timeout: 60000
53+
- tapOn:
54+
id: 'rooms-list-view-item-${output.otherUser.username}'
55+
- tapOn:
56+
id: header-back
57+
- extendedWaitUntil:
58+
notVisible:
59+
id: 'mention-badge-1'
60+
childOf:
61+
id: 'rooms-list-view-item-${output.otherUser.username}'
62+
timeout: 60000
63+
64+
# send normal message first and mention in next message and it should show mentioned unread indicator
65+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
66+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
67+
- extendedWaitUntil:
68+
visible:
69+
id: 'rooms-list-view-item-${output.otherUser.username}'
70+
timeout: 60000
71+
- extendedWaitUntil:
72+
visible:
73+
id: 'mention-badge-2'
74+
childOf:
75+
id: 'rooms-list-view-item-${output.otherUser.username}'
76+
timeout: 60000
77+
- tapOn:
78+
id: 'rooms-list-view-item-${output.otherUser.username}'
79+
- tapOn:
80+
id: header-back
81+
- extendedWaitUntil:
82+
notVisible:
83+
id: 'mention-badge-2'
84+
childOf:
85+
id: 'rooms-list-view-item-${output.otherUser.username}'
86+
timeout: 60000
87+
88+
# send mention message first and normal message in next message and it should show mentioned unread indicator
89+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, '@' + output.user.username)}
90+
- evalScript: ${output.message = output.utils.sendMessage(output.otherUser.username, output.otherUser.password, '@' + output.user.username, 'message-mark-as-unread')}
91+
- extendedWaitUntil:
92+
visible:
93+
id: 'rooms-list-view-item-${output.otherUser.username}'
94+
timeout: 60000
95+
- extendedWaitUntil:
96+
visible:
97+
id: 'mention-badge-2'
98+
childOf:
99+
id: 'rooms-list-view-item-${output.otherUser.username}'
100+
timeout: 60000
101+
- tapOn:
102+
id: 'rooms-list-view-item-${output.otherUser.username}'
103+
- tapOn:
104+
id: header-back
105+
- extendedWaitUntil:
106+
notVisible:
107+
id: 'mention-badge-2'
108+
childOf:
109+
id: 'rooms-list-view-item-${output.otherUser.username}'
110+
timeout: 60000

app/containers/Avatar/Avatar.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@ const Avatar = React.memo(
3434
avatarExternalProviderUrl,
3535
roomAvatarExternalProviderUrl,
3636
cdnPrefix,
37-
accessibilityLabel
37+
accessibilityLabel,
38+
accessible = true
3839
}: IAvatar) => {
3940
if ((!text && !avatar && !emoji && !rid) || !server) {
4041
return null;
@@ -96,15 +97,15 @@ const Avatar = React.memo(
9697

9798
if (onPress) {
9899
image = (
99-
<Touchable accessibilityLabel={avatarAccessibilityLabel} onPress={onPress}>
100+
<Touchable accessible={accessible} accessibilityLabel={avatarAccessibilityLabel} onPress={onPress}>
100101
{image}
101102
</Touchable>
102103
);
103104
}
104105

105106
return (
106107
<View
107-
accessible
108+
accessible={accessible}
108109
accessibilityLabel={!onPress ? avatarAccessibilityLabel : undefined}
109110
style={[avatarStyle, style]}
110111
testID='avatar'>

app/containers/Avatar/AvatarContainer.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ const AvatarContainer = ({
2020
getCustomEmoji,
2121
isStatic,
2222
rid,
23-
accessibilityLabel
23+
accessibilityLabel,
24+
accessible
2425
}: IAvatar): React.ReactElement => {
2526
const server = useAppSelector(state => state.server.server);
2627
const serverVersion = useAppSelector(state => state.server.version);
@@ -71,6 +72,7 @@ const AvatarContainer = ({
7172
serverVersion={serverVersion}
7273
cdnPrefix={cdnPrefix}
7374
accessibilityLabel={accessibilityLabel}
75+
accessible={accessible}
7476
/>
7577
);
7678
};

app/containers/Avatar/interfaces.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,5 @@ export interface IAvatar {
2626
roomAvatarExternalProviderUrl?: string;
2727
cdnPrefix?: string;
2828
accessibilityLabel?: string;
29+
accessible?: boolean;
2930
}

app/containers/CustomIcon/index.tsx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
11
import React, { memo } from 'react';
2-
import { createIconSetFromIcoMoon } from 'react-native-vector-icons';
3-
import type { IconProps } from 'react-native-vector-icons/Icon';
2+
import { createIconSetFromIcoMoon } from '@expo/vector-icons';
3+
import type { StyleProp, TextStyle } from 'react-native';
44

55
import { type mappedIcons } from './mappedIcons';
66
import { useTheme } from '../../theme';
77
import { useResponsiveLayout } from '../../lib/hooks/useResponsiveLayout/useResponsiveLayout';
8-
9-
const icoMoonConfig = require('./selection.json');
8+
import icoMoonConfig from './selection.json';
109

1110
export const IconSet = createIconSetFromIcoMoon(icoMoonConfig, 'custom', 'custom.ttf');
1211

12+
const glyphMap = IconSet.getRawGlyphMap
13+
? IconSet.getRawGlyphMap()
14+
: icoMoonConfig.icons?.reduce((map: Record<string, string | number>, glyph: any) => {
15+
map[glyph.icon.name] = glyph.icon.code;
16+
return map;
17+
}, {}) || {};
18+
19+
export const hasIcon = (name: string) => Object.prototype.hasOwnProperty.call(glyphMap, name);
20+
1321
export type TIconsName = keyof typeof mappedIcons;
1422

15-
export interface ICustomIcon extends IconProps {
23+
export interface ICustomIcon extends React.ComponentProps<typeof IconSet> {
1624
name: TIconsName;
1725
size: number;
1826
color?: string;
27+
style?: StyleProp<TextStyle>;
1928
}
2029

2130
const CustomIcon = memo(({ name, size, color, style, ...props }: ICustomIcon): React.ReactElement => {

0 commit comments

Comments
 (0)