Skip to content

Commit c925a27

Browse files
authored
chore: migrate react-native-platform-touchable to RNGH (#6997)
1 parent b99320a commit c925a27

File tree

65 files changed

+113768
-95665
lines changed

Some content is hidden

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

65 files changed

+113768
-95665
lines changed

.maestro/helpers/send-message.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,5 @@ tags:
2828
id: message-composer-send
2929
- extendedWaitUntil:
3030
visible:
31-
text: '.*${message}.*'
31+
id: 'message-content-${message}'
3232
timeout: 60000

.maestro/tests/assorted/profile.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ tags:
6868
# submit button should be disabled because of no changes
6969
- assertVisible:
7070
id: 'profile-view-submit'
71-
enabled: false
7271

7372
# should have new password
7473
- scrollUntilVisible:

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,11 @@ tags:
88
- tapOn: New password
99
- inputText: ${output.data.e2eePassword}
1010
- runFlow: '../../../helpers/hide-keyboard.yaml'
11-
- swipe:
12-
direction: DOWN
13-
duration: 100
11+
- scrollUntilVisible:
12+
element:
13+
text: 'Save Changes'
14+
timeout: 60000
15+
centerElement: true
1416
- tapOn: Save Changes
1517
- extendedWaitUntil:
1618
visible:

.maestro/tests/room/jump-to-message.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ tags:
153153
text: '.*Load newer.*'
154154
direction: DOWN
155155
timeout: 60000
156+
centerElement: true
156157
- tapOn:
157158
text: 'Load newer'
158159
retryTapIfNoChange: true
Lines changed: 197 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,197 @@
1+
appId: chat.rocket.reactnative
2+
name: Message Markdown
3+
jsEngine: graaljs
4+
onFlowStart:
5+
- runFlow: '../../helpers/setup.yaml'
6+
onFlowComplete:
7+
- evalScript: ${output.utils.deleteCreatedUsers()}
8+
tags:
9+
- test-12
10+
11+
---
12+
- evalScript: ${output.user = output.utils.createUser()}
13+
14+
- runFlow:
15+
file: '../../helpers/login-with-deeplink.yaml'
16+
env:
17+
USERNAME: ${output.user.username}
18+
PASSWORD: ${output.user.password}
19+
- runFlow:
20+
file: '../../helpers/search-and-navigate-room.yaml'
21+
env:
22+
ROOM: 'maestro-message-clickable-test'
23+
24+
- extendedWaitUntil:
25+
visible:
26+
text: 'Link with text https://www.rocket.chat'
27+
timeout: 60000
28+
- extendedWaitUntil:
29+
visible:
30+
text: '.*detox-public*.'
31+
timeout: 60000
32+
- extendedWaitUntil:
33+
visible:
34+
text: '.*e2e_admin*.'
35+
timeout: 60000
36+
- extendedWaitUntil:
37+
visible:
38+
text: '.*Message with thread*.'
39+
timeout: 60000
40+
- extendedWaitUntil:
41+
visible:
42+
id: 'message-thread-button-message with thread'
43+
timeout: 60000
44+
45+
# Tap on detox-public mention to open room info
46+
- tapOn:
47+
text: '.*detox-public*.'
48+
49+
# Verify room info view is shown
50+
- extendedWaitUntil:
51+
visible:
52+
id: 'room-info-view'
53+
timeout: 60000
54+
55+
# Verify room name is visible in room info
56+
- assertVisible:
57+
text: '.*detox-public.*'
58+
59+
# Go back to room
60+
- tapOn:
61+
id: custom-header-back
62+
63+
# Wait for room view to be visible again
64+
- extendedWaitUntil:
65+
visible:
66+
id: 'room-view-title-maestro-message-clickable-test'
67+
timeout: 60000
68+
69+
# Tap on the URL link to open alert
70+
- runFlow:
71+
when:
72+
platform: Android
73+
commands:
74+
- tapOn:
75+
text: '.*https://www.rocket.chat.*'
76+
- runFlow:
77+
when:
78+
platform: iOS
79+
commands:
80+
- tapOn:
81+
point: 66%,66%
82+
83+
# Verify alert is shown with the link
84+
- extendedWaitUntil:
85+
visible:
86+
text: '.*Link Pressed*.'
87+
timeout: 10000
88+
89+
- assertVisible:
90+
text: '.*https://www.rocket.chat*.'
91+
92+
# Dismiss the alert
93+
- tapOn:
94+
text: 'OK'
95+
optional: true
96+
97+
# Long press on the link to copy to clipboard
98+
- runFlow:
99+
when:
100+
platform: Android
101+
commands:
102+
- longPressOn:
103+
text: '.*https://www.rocket.chat.*'
104+
- runFlow:
105+
when:
106+
platform: iOS
107+
commands:
108+
- longPressOn:
109+
point: 66%,66%
110+
111+
# Verify clipboard has the link alert
112+
- extendedWaitUntil:
113+
visible:
114+
text: '.*Link Long Pressed*.'
115+
timeout: 10000
116+
117+
- assertVisible:
118+
text: '.*https://www.rocket.chat*.'
119+
120+
# Dismiss the alert
121+
- tapOn:
122+
text: 'OK'
123+
optional: true
124+
125+
# Tap on e2e_admin mention to open user info
126+
- tapOn:
127+
text: '.*e2e_admin*.'
128+
129+
# Verify user info view is shown
130+
- extendedWaitUntil:
131+
visible:
132+
text: '.*User info*.'
133+
timeout: 60000
134+
135+
# Verify username is visible in user info
136+
- assertVisible:
137+
text: '.*e2e_admin.*'
138+
139+
# Go back to room
140+
- tapOn:
141+
id: custom-header-back
142+
143+
# Wait for room view to be visible again
144+
- extendedWaitUntil:
145+
visible:
146+
id: 'room-view-title-maestro-message-clickable-test'
147+
timeout: 60000
148+
149+
# Tap on message with thread to open thread room
150+
- tapOn:
151+
text: '.*Message with thread*.'
152+
153+
# Verify thread room view is opened with the correct id
154+
- extendedWaitUntil:
155+
visible:
156+
id: 'room-view-title-message with thread'
157+
timeout: 60000
158+
159+
# Go back to main room
160+
- tapOn:
161+
id: header-back
162+
163+
# Wait for room view to be visible again
164+
- extendedWaitUntil:
165+
visible:
166+
id: 'room-view-title-maestro-message-clickable-test'
167+
timeout: 60000
168+
169+
# Tap on "View thread" button
170+
- tapOn:
171+
id: 'message-thread-button-message with thread'
172+
173+
# Verify thread room view is opened
174+
- extendedWaitUntil:
175+
visible:
176+
id: 'room-view-title-message with thread'
177+
timeout: 60000
178+
179+
# Go back to main room
180+
- tapOn:
181+
id: header-back
182+
183+
# Wait for room view to be visible again
184+
- extendedWaitUntil:
185+
visible:
186+
id: 'room-view-title-maestro-message-clickable-test'
187+
timeout: 60000
188+
189+
# Now tap on a message within the thread
190+
- tapOn:
191+
text: '.*a message in thread*.'
192+
193+
# Verify thread room view remains (clicking message in thread stays in thread)
194+
- extendedWaitUntil:
195+
visible:
196+
id: 'room-view-title-message with thread'
197+
timeout: 60000

.maestro/tests/room/room-info.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@ tags:
290290
env:
291291
id: 'room-info-edit-view-name'
292292
- inputText: ${output.newroomname}
293-
- pressKey: Enter
293+
- runFlow: '../../helpers/hide-keyboard.yaml'
294294
- scrollUntilVisible:
295295
element:
296296
id: 'room-info-edit-view-submit'
@@ -321,6 +321,14 @@ tags:
321321
timeout: 60000
322322

323323
# should change room description, topic, announcement
324+
- runFlow:
325+
when:
326+
platform: iOS
327+
commands:
328+
- extendedWaitUntil:
329+
notVisible:
330+
text: '.*Settings succesfully changed.*'
331+
timeout: 60000
324332
- scrollUntilVisible:
325333
element:
326334
id: 'room-info-edit-view-topic'

.maestro/tests/room/room.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ tags:
161161
- tapOn:
162162
id: emoji-searchbar-input
163163
- inputText: 'laughing'
164-
- runFlow: '../../helpers/hide-keyboard.yaml'
165164
- extendedWaitUntil:
166165
visible:
167166
id: emoji-laughing

.maestro/tests/room/share-message.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ tags:
6868
- tapOn:
6969
id: 'multi-select-search'
7070
- inputText: ${output.otherUser.username}
71-
- runFlow: '../../helpers/hide-keyboard.yaml'
7271
- extendedWaitUntil:
7372
visible:
7473
id: multi-select-item-${output.otherUser.username.toLowerCase()}

.maestro/tests/teams/team.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ tags:
107107
id: create-channel-name
108108
- inputText: ${output.privateRoomName}
109109
- runFlow: '../../helpers/hide-keyboard.yaml'
110-
- extendedWaitUntil:
111-
visible:
112-
id: create-channel-submit
110+
- scrollUntilVisible:
111+
element:
112+
id: 'create-channel-submit'
113113
timeout: 60000
114-
label: should have submit button
114+
centerElement: true
115115
- tapOn:
116116
id: create-channel-submit
117117
- extendedWaitUntil:

app/containers/Avatar/Avatar.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import React from 'react';
22
import { View } from 'react-native';
33
import { Image } from 'expo-image';
4-
import Touchable from 'react-native-platform-touchable';
54
import { settings as RocketChatSettings } from '@rocket.chat/sdk';
65

76
import Emoji from '../markdown/components/emoji/Emoji';
@@ -10,6 +9,7 @@ import { SubscriptionType } from '../../definitions';
109
import { type IAvatar } from './interfaces';
1110
import MarkdownContext from '../markdown/contexts/MarkdownContext';
1211
import I18n from '../../i18n';
12+
import Touch from '../Touch';
1313

1414
const Avatar = React.memo(
1515
({
@@ -97,9 +97,9 @@ const Avatar = React.memo(
9797

9898
if (onPress) {
9999
image = (
100-
<Touchable accessible={accessible} accessibilityLabel={avatarAccessibilityLabel} onPress={onPress}>
100+
<Touch accessible={accessible} accessibilityLabel={avatarAccessibilityLabel} onPress={onPress}>
101101
{image}
102-
</Touchable>
102+
</Touch>
103103
);
104104
}
105105

0 commit comments

Comments
 (0)