feat(Android): Remove Open workspace from onboarding (#5065)

* Remove Open

* Remove on Android only and comment tests out
This commit is contained in:
Diego Mello 2023-05-10 17:22:18 -03:00 committed by GitHub
parent edea063cf6
commit c00ab98441
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 42 additions and 38 deletions

View File

@ -22,7 +22,7 @@ import { sanitizeLikeString } from '../../lib/database/utils';
import UserPreferences from '../../lib/methods/userPreferences';
import { OutsideParamList } from '../../stacks/types';
import { withTheme } from '../../theme';
import { isTablet } from '../../lib/methods/helpers';
import { isIOS, isTablet } from '../../lib/methods/helpers';
import EventEmitter from '../../lib/methods/helpers/events';
import { BASIC_AUTH_KEY, setBasicAuth } from '../../lib/methods/helpers/fetch';
import { showConfirmationAlert } from '../../lib/methods/helpers/info';
@ -392,28 +392,32 @@ class NewServerView extends React.Component<INewServerViewProps, INewServerViewS
style={[styles.connectButton, { marginTop: verticalScale({ size: 16, height }) }]}
testID='new-server-view-button'
/>
<OrSeparator theme={theme} />
<Text
style={[
styles.description,
{
color: themes[theme].auxiliaryText,
fontSize: moderateScale({ size: 14, width }),
marginBottom: verticalScale({ size: 16, height })
}
]}
>
{I18n.t('Onboarding_join_open_description')}
</Text>
<Button
title={I18n.t('Join_our_open_workspace')}
type='secondary'
backgroundColor={themes[theme].chatComponentBackground}
onPress={this.connectOpen}
disabled={connecting}
loading={connectingOpen && connecting}
testID='new-server-view-open'
/>
{isIOS ? (
<>
<OrSeparator theme={theme} />
<Text
style={[
styles.description,
{
color: themes[theme].auxiliaryText,
fontSize: moderateScale({ size: 14, width }),
marginBottom: verticalScale({ size: 16, height })
}
]}
>
{I18n.t('Onboarding_join_open_description')}
</Text>
<Button
title={I18n.t('Join_our_open_workspace')}
type='secondary'
backgroundColor={themes[theme].chatComponentBackground}
onPress={this.connectOpen}
disabled={connecting}
loading={connectingOpen && connecting}
testID='new-server-view-open'
/>
</>
) : null}
</FormContainerInner>
{this.renderCertificatePicker()}
</FormContainer>

View File

@ -33,9 +33,9 @@ describe('i18n', () => {
({ textMatcher } = platformTypes[device.getPlatform()]);
});
it("OS set to 'en' and proper translate to 'en'", async () => {
// if (device.getPlatform() === 'android') {
// return; // FIXME: Passing language with launch parameters doesn't work with Android
// }
if (device.getPlatform() === 'android') {
return; // FIXME: Passing language with launch parameters doesn't work with Android
}
await device.launchApp({
...defaultLaunchArgs,
languageAndLocale: {
@ -54,9 +54,9 @@ describe('i18n', () => {
});
it("OS set to unavailable language and fallback to 'en'", async () => {
// if (device.getPlatform() === 'android') {
// return; // FIXME: Passing language with launch parameters doesn't work with Android
// }
if (device.getPlatform() === 'android') {
return; // FIXME: Passing language with launch parameters doesn't work with Android
}
await device.launchApp({
...defaultLaunchArgs,
languageAndLocale: {

View File

@ -19,9 +19,9 @@ describe('Onboarding', () => {
await expect(element(by.id('new-server-view'))).toBeVisible();
});
it('should have "Join our open workspace"', async () => {
await expect(element(by.id('new-server-view-open'))).toBeVisible();
});
// it('should have "Join our open workspace"', async () => {
// await expect(element(by.id('new-server-view-open'))).toBeVisible();
// });
});
describe('Usage', () => {
@ -34,12 +34,12 @@ describe('Onboarding', () => {
await element(by[textMatcher]('OK').and(by.type(alertButtonType))).tap();
});
it('should tap on "Join our open workspace" and navigate', async () => {
await element(by.id('new-server-view-open')).tap();
await waitFor(element(by.id('workspace-view')))
.toBeVisible()
.withTimeout(60000);
});
// it('should tap on "Join our open workspace" and navigate', async () => {
// await element(by.id('new-server-view-open')).tap();
// await waitFor(element(by.id('workspace-view')))
// .toBeVisible()
// .withTimeout(60000);
// });
it('should enter a valid server without login services and navigate to login', async () => {
await device.launchApp({ newInstance: true });