Chore: Update Detox to 19.7.0 (#4215)

Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
Reinaldo Neto 2022-05-26 14:10:24 -03:00 committed by GitHub
parent 5101ab4769
commit bc34706f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 53 additions and 51 deletions

View File

@ -37,6 +37,7 @@ const BottomSheetContent = React.memo(({ options, hasCancel, hide, children }: I
if (options) { if (options) {
return ( return (
<BottomSheetFlatList <BottomSheetFlatList
testID='action-sheet'
data={options} data={options}
refreshing={false} refreshing={false}
keyExtractor={item => item.title} keyExtractor={item => item.title}

View File

@ -16,7 +16,7 @@ interface ICustomIcon extends TextProps {
color: string; color: string;
} }
const CustomIcon = ({ name, size, color, testID, ...props }: ICustomIcon) => ( const CustomIcon = ({ name, size, color, ...props }: ICustomIcon) => (
// @ts-ignore TODO remove this after update @types/react-native to 0.65.0 // @ts-ignore TODO remove this after update @types/react-native to 0.65.0
<IconSet name={name} size={size} color={color} {...props} /> <IconSet name={name} size={size} color={color} {...props} />
); );

View File

@ -6,7 +6,7 @@ import { useTheme } from '../../theme';
import { themes } from '../../lib/constants'; import { themes } from '../../lib/constants';
import styles from './styles'; import styles from './styles';
const Edited = memo(({ isEdited }: { isEdited: boolean }) => { const Edited = memo(({ isEdited, testID }: { isEdited: boolean; testID?: string }) => {
const { theme } = useTheme(); const { theme } = useTheme();
if (!isEdited) { if (!isEdited) {
@ -14,7 +14,7 @@ const Edited = memo(({ isEdited }: { isEdited: boolean }) => {
} }
return ( return (
<View style={styles.leftIcons}> <View testID={testID} style={styles.leftIcons}>
<CustomIcon name='edit' size={16} color={themes[theme].auxiliaryText} /> <CustomIcon name='edit' size={16} color={themes[theme].auxiliaryText} />
</View> </View>
); );

View File

@ -106,7 +106,7 @@ const Message = React.memo((props: IMessage) => {
</View> </View>
{!props.isHeader ? ( {!props.isHeader ? (
<> <>
<Edited isEdited={props.isEdited} /> <Edited testID={`${props.msg}-edited`} isEdited={props.isEdited} />
<MessageError hasError={props.hasError} /> <MessageError hasError={props.hasError} />
</> </>
) : null} ) : null}

View File

@ -38,28 +38,28 @@ async function navigateToLogin(server) {
await navigateToWorkspace(server); await navigateToWorkspace(server);
await element(by.id('workspace-view-login')).tap(); await element(by.id('workspace-view-login')).tap();
await waitFor(element(by.id('login-view'))) await waitFor(element(by.id('login-view')))
.toBeVisible() .toExist()
.withTimeout(2000); .withTimeout(2000);
await expect(element(by.id('login-view'))).toBeVisible(); await expect(element(by.id('login-view'))).toExist();
} }
async function navigateToRegister(server) { async function navigateToRegister(server) {
await navigateToWorkspace(server); await navigateToWorkspace(server);
await element(by.id('workspace-view-register')).tap(); await element(by.id('workspace-view-register')).tap();
await waitFor(element(by.id('register-view'))) await waitFor(element(by.id('register-view')))
.toBeVisible() .toExist()
.withTimeout(2000); .withTimeout(2000);
} }
async function login(username, password) { async function login(username, password) {
await waitFor(element(by.id('login-view'))) await waitFor(element(by.id('login-view')))
.toBeVisible() .toExist()
.withTimeout(2000); .withTimeout(2000);
await element(by.id('login-view-email')).replaceText(username); await element(by.id('login-view-email')).replaceText(username);
await element(by.id('login-view-password')).replaceText(password); await element(by.id('login-view-password')).replaceText(password);
await element(by.id('login-view-submit')).tap(); await element(by.id('login-view-submit')).tap();
await waitFor(element(by.id('rooms-list-view'))) await waitFor(element(by.id('rooms-list-view')))
.toBeVisible() .toExist()
.withTimeout(30000); .withTimeout(30000);
} }

View File

@ -28,6 +28,7 @@ describe('Create user screen', () => {
}); });
it('should have submit button', async () => { it('should have submit button', async () => {
await element(by.id('register-view')).atIndex(0).swipe('up', 'fast', 0.5);
await expect(element(by.id('register-view-submit'))).toBeVisible(); await expect(element(by.id('register-view-submit'))).toBeVisible();
}); });

View File

@ -12,7 +12,7 @@ describe('Login screen', () => {
describe('Render', () => { describe('Render', () => {
it('should have login screen', async () => { it('should have login screen', async () => {
await expect(element(by.id('login-view'))).toBeVisible(); await expect(element(by.id('login-view'))).toExist();
}); });
it('should have email input', async () => { it('should have email input', async () => {
@ -44,7 +44,7 @@ describe('Login screen', () => {
it('should navigate to register', async () => { it('should navigate to register', async () => {
await element(by.id('login-view-register')).tap(); await element(by.id('login-view-register')).tap();
await waitFor(element(by.id('register-view'))) await waitFor(element(by.id('register-view')))
.toBeVisible() .toExist()
.withTimeout(2000); .withTimeout(2000);
await tapBack(); await tapBack();
}); });

View File

@ -44,7 +44,7 @@ describe('Rooms list screen', () => {
await tapBack(); await tapBack();
await waitFor(element(by.id('rooms-list-view'))) await waitFor(element(by.id('rooms-list-view')))
.toBeVisible() .toBeVisible()
.withTimeout(2000); .withTimeout(6000);
await waitFor(element(by.id('rooms-list-view-item-rocket.cat'))) await waitFor(element(by.id('rooms-list-view-item-rocket.cat')))
.toExist() .toExist()
.withTimeout(60000); .withTimeout(60000);

View File

@ -13,6 +13,9 @@ describe('Create room screen', () => {
describe('New Message', () => { describe('New Message', () => {
before(async () => { before(async () => {
await waitFor(element(by.id('rooms-list-view-create-channel')))
.toBeVisible()
.withTimeout(10000);
await element(by.id('rooms-list-view-create-channel')).tap(); await element(by.id('rooms-list-view-create-channel')).tap();
}); });

View File

@ -121,6 +121,9 @@ describe('Room screen', () => {
await waitFor(element(by.id('messagebox-container'))) await waitFor(element(by.id('messagebox-container')))
.toExist() .toExist()
.withTimeout(10000); .withTimeout(10000);
await waitFor(element(by.id('mention-item-joy')))
.toExist()
.withTimeout(10000);
await element(by.id('mention-item-joy')).tap(); await element(by.id('mention-item-joy')).tap();
await expect(element(by.id('messagebox-input'))).toHaveText(':joy: '); await expect(element(by.id('messagebox-input'))).toHaveText(':joy: ');
await element(by.id('messagebox-input')).clearText(); await element(by.id('messagebox-input')).clearText();
@ -275,7 +278,7 @@ describe('Room screen', () => {
await element(by.id('reaction-picker-😃')).tap(); await element(by.id('reaction-picker-😃')).tap();
await waitFor(element(by.id('reaction-picker-grinning'))) await waitFor(element(by.id('reaction-picker-grinning')))
.toExist() .toExist()
.withTimeout(2000); .withTimeout(10000);
await element(by.id('reaction-picker-grinning')).tap(); await element(by.id('reaction-picker-grinning')).tap();
await waitFor(element(by.id('message-reaction-:grinning:'))) await waitFor(element(by.id('message-reaction-:grinning:')))
.toExist() .toExist()
@ -342,7 +345,10 @@ describe('Room screen', () => {
await element(by[textMatcher]('Edit')).atIndex(0).tap(); await element(by[textMatcher]('Edit')).atIndex(0).tap();
await element(by.id('messagebox-input')).replaceText(`${data.random}edited`); await element(by.id('messagebox-input')).replaceText(`${data.random}edited`);
await element(by.id('messagebox-send-message')).tap(); await element(by.id('messagebox-send-message')).tap();
await waitFor(element(by[textMatcher](`${data.random}edited (edited)`)).atIndex(0)) await waitFor(element(by[textMatcher](`${data.random}edited`)).atIndex(0))
.toExist()
.withTimeout(60000);
await waitFor(element(by.id(`${data.random}edited-edited`)))
.toExist() .toExist()
.withTimeout(60000); .withTimeout(60000);
}); });

View File

@ -81,11 +81,11 @@ describe('Room', () => {
it('should tap FAB and scroll to bottom', async () => { it('should tap FAB and scroll to bottom', async () => {
await waitFor(element(by.id('nav-jump-to-bottom'))) await waitFor(element(by.id('nav-jump-to-bottom')))
.toExist() .toExist()
.withTimeout(5000); .withTimeout(15000);
await element(by.id('nav-jump-to-bottom')).tap(); await element(by.id('nav-jump-to-bottom')).tap();
await waitFor(element(by[textMatcher]('Quote first message'))) await waitFor(element(by[textMatcher]('Quote first message')))
.toExist() .toExist()
.withTimeout(5000); .withTimeout(15000);
await clearCache(); await clearCache();
}); });

View File

@ -396,8 +396,8 @@ describe('Team', () => {
.toExist() .toExist()
.withTimeout(5000); .withTimeout(5000);
await element(by.id(`select-list-view-item-${room}`)).tap(); await element(by.id(`select-list-view-item-${room}`)).tap();
await waitFor(element(by.id(`${room}-unchecked`))) await waitFor(element(by.id(`${room}-checked`)))
.toExist() .toNotExist()
.withTimeout(5000); .withTimeout(5000);
await element(by.id('select-list-view-submit')).tap(); await element(by.id('select-list-view-submit')).tap();
await waitFor(element(by.id('room-members-view-item-rocket.cat'))) await waitFor(element(by.id('room-members-view-item-rocket.cat')))

View File

@ -174,7 +174,7 @@
"babel-jest": "^27.0.6", "babel-jest": "^27.0.6",
"babel-plugin-transform-remove-console": "^6.9.4", "babel-plugin-transform-remove-console": "^6.9.4",
"codecov": "^3.8.3", "codecov": "^3.8.3",
"detox": "18.17.0", "detox": "19.7.0",
"eslint": "^7.31.0", "eslint": "^7.31.0",
"eslint-config-prettier": "^8.3.0", "eslint-config-prettier": "^8.3.0",
"eslint-plugin-import": "2.22.0", "eslint-plugin-import": "2.22.0",

File diff suppressed because one or more lines are too long

View File

@ -5347,6 +5347,16 @@ ajv@^8.0.1:
require-from-string "^2.0.2" require-from-string "^2.0.2"
uri-js "^4.2.2" uri-js "^4.2.2"
ajv@^8.6.3:
version "8.11.0"
resolved "https://registry.yarnpkg.com/ajv/-/ajv-8.11.0.tgz#977e91dd96ca669f54a11e23e378e33b884a565f"
integrity sha512-wGgprdCvMalC0BztXvitD2hC04YffAvtsUn93JbGXYLAtCUO4xd17mCCZQxUOItiBwZvJScWo8NIvQMQ71rdpg==
dependencies:
fast-deep-equal "^3.1.1"
json-schema-traverse "^1.0.0"
require-from-string "^2.0.2"
uri-js "^4.2.2"
anser@^1.4.9: anser@^1.4.9:
version "1.4.10" version "1.4.10"
resolved "https://registry.yarnpkg.com/anser/-/anser-1.4.10.tgz#befa3eddf282684bd03b63dcda3927aef8c2e35b" resolved "https://registry.yarnpkg.com/anser/-/anser-1.4.10.tgz#befa3eddf282684bd03b63dcda3927aef8c2e35b"
@ -6617,12 +6627,12 @@ builtin-status-codes@^3.0.0:
resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8" resolved "https://registry.yarnpkg.com/builtin-status-codes/-/builtin-status-codes-3.0.0.tgz#85982878e21b98e1c66425e03d0174788f569ee8"
integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug= integrity sha1-hZgoeOIbmOHGZCXgPQF0eI9Wnug=
bunyan-debug-stream@^1.1.0: bunyan-debug-stream@^2.0.1:
version "1.1.1" version "2.0.1"
resolved "https://registry.yarnpkg.com/bunyan-debug-stream/-/bunyan-debug-stream-1.1.1.tgz#4740a00b7d5c2d9d1b714925ab0802516040813e" resolved "https://registry.yarnpkg.com/bunyan-debug-stream/-/bunyan-debug-stream-2.0.1.tgz#9bd7c7e30c7b2cf711317e9d37529b0464c3b164"
integrity sha512-jJbQ1gXUL6vMmZVdbaTFK1v1sGa7axLrSQQwkB6HU9HCPTzsw2HsKcPHm1vgXZlEck/4IvEuRwg/9+083YelCg== integrity sha512-MCEoqggU7NMt7f2O+PU8VkqfSkoQoa4lmN/OWhaRfqFRBF1Se2TOXQyLF6NxC+EtfrdthnquQe8jOe83fpEoGA==
dependencies: dependencies:
colors "^1.0.3" colors "1.4.0"
exception-formatter "^1.0.4" exception-formatter "^1.0.4"
bunyan@^1.8.12: bunyan@^1.8.12:
@ -7195,7 +7205,7 @@ colorette@^1.2.1, colorette@^1.2.2:
resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94" resolved "https://registry.yarnpkg.com/colorette/-/colorette-1.2.2.tgz#cbcc79d5e99caea2dbf10eb3a26fd8b3e6acfa94"
integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w== integrity sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==
colors@^1.0.3, colors@^1.1.2: colors@1.4.0, colors@^1.0.3, colors@^1.1.2:
version "1.4.0" version "1.4.0"
resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78"
integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==
@ -8004,19 +8014,19 @@ detect-port@^1.3.0:
address "^1.0.1" address "^1.0.1"
debug "^2.6.0" debug "^2.6.0"
detox@18.17.0: detox@^19.7.0:
version "18.17.0" version "19.7.0"
resolved "https://registry.yarnpkg.com/detox/-/detox-18.17.0.tgz#29c5c7578f7a880964345af3d108705258a7dfd0" resolved "https://registry.yarnpkg.com/detox/-/detox-19.7.0.tgz#278994beb98b959d21f1d4f393c628005c893122"
integrity sha512-cdi+nUgk0Me76UdG7pUYIchmfEdzSghIC0xjTrEMyjhBz2Zsb7WscZZHO1rORAjDHJF7u0QhvAHvGDksDWmjiw== integrity sha512-70a6IQCBQCJI21ITdK+qGUQ7fQL/CeOW+i0Vdr0ZFN5B5RylSE9d5shoJBtg2nb8XYG+S9BLqhn+uE02Nqymng==
dependencies: dependencies:
ajv "^8.6.3"
bunyan "^1.8.12" bunyan "^1.8.12"
bunyan-debug-stream "^1.1.0" bunyan-debug-stream "^2.0.1"
chalk "^2.4.2" chalk "^2.4.2"
child-process-promise "^2.2.0" child-process-promise "^2.2.0"
find-up "^4.1.0" find-up "^4.1.0"
fs-extra "^4.0.2" fs-extra "^4.0.2"
funpermaproxy "^1.0.1" funpermaproxy "^1.0.1"
get-port "^2.1.0"
ini "^1.3.4" ini "^1.3.4"
lodash "^4.17.5" lodash "^4.17.5"
minimist "^1.2.0" minimist "^1.2.0"
@ -9743,13 +9753,6 @@ get-package-type@^0.1.0:
resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a"
integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==
get-port@^2.1.0:
version "2.1.0"
resolved "https://registry.yarnpkg.com/get-port/-/get-port-2.1.0.tgz#8783f9dcebd1eea495a334e1a6a251e78887ab1a"
integrity sha1-h4P53OvR7qSVozThpqJR54iHqxo=
dependencies:
pinkie-promise "^2.0.0"
get-stream@^4.0.0: get-stream@^4.0.0:
version "4.1.0" version "4.1.0"
resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@ -14036,18 +14039,6 @@ pify@^4.0.1:
resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231" resolved "https://registry.yarnpkg.com/pify/-/pify-4.0.1.tgz#4b2cd25c50d598735c50292224fd8c6df41e3231"
integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g== integrity sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==
pinkie-promise@^2.0.0:
version "2.0.1"
resolved "https://registry.yarnpkg.com/pinkie-promise/-/pinkie-promise-2.0.1.tgz#2135d6dfa7a358c069ac9b178776288228450ffa"
integrity sha1-ITXW36ejWMBprJsXh3YogihFD/o=
dependencies:
pinkie "^2.0.0"
pinkie@^2.0.0:
version "2.0.4"
resolved "https://registry.yarnpkg.com/pinkie/-/pinkie-2.0.4.tgz#72556b80cfa0d48a974e80e77248e80ed4f7f870"
integrity sha1-clVrgM+g1IqXToDnckjoDtT3+HA=
pirates@^4.0.1: pirates@^4.0.1:
version "4.0.1" version "4.0.1"
resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87" resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.1.tgz#643a92caf894566f91b2b986d2c66950a8e2fb87"