Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
githubquiet committed Oct 18, 2023
1 parent d58b32c commit 68238f4
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 13 deletions.
43 changes: 43 additions & 0 deletions packages/mobile/e2e/multi.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import press from './utils/press'
import write from './utils/write'
import info from './utils/info'
import { BASIC, LONG, STARTUP } from './utils/consts/timeouts'

const { ios } = info

const username = `user_${Math.random().toString(36).substring(2, 6)}`

describe('User', () => {
beforeAll(async () => {
await device.launchApp({ newInstance: true, launchArgs: { detoxDebugVisibility: 'YES' } })
})

test('should see join community screen', async () => {
await waitFor(element(by.text('Join community')))
.toBeVisible()
.withTimeout(STARTUP)
})

test('enters invitation code', async () => {
await write(element(by.id('input')), process.env.INVITATION_CODE)

if (!ios) await device.pressBack()

await press(element(by.text('Continue')))

await waitFor(element(by.text('Register a username')))
.toBeVisible()
.withTimeout(BASIC)
})

test('enters username', async () => {
await write(element(by.id('input')), username)
await press(element(by.text('Continue')))
})

// test('sees channels list', async () => {
// await waitFor(element(by.id('channels_list')))
// .toBeVisible()
// .withTimeout(STARTUP)
// })
})
11 changes: 3 additions & 8 deletions packages/mobile/src/components/Button/Button.component.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React, { FC } from 'react'
import { TouchableWithoutFeedback, View } from 'react-native'
import { ButtonProps } from './Button.types'
import * as Progress from 'react-native-progress'
import { Typography } from '../Typography/Typography.component'
import { defaultTheme } from '../../styles/themes/default.theme'

Expand All @@ -26,13 +25,9 @@ export const Button: FC<ButtonProps> = ({ onPress, title, width, loading, negati
width,
}}
>
{!loading ? (
<Typography fontSize={14} color={!negative ? 'white' : 'gray50'}>
{title}
</Typography>
) : (
<Progress.CircleSnail color={['white']} size={20} thickness={1.5} />
)}
<Typography fontSize={14} color={!negative ? 'white' : 'gray50'}>
{title}
</Typography>
</View>
</TouchableWithoutFeedback>
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,6 @@ export const UsernameRegistration: FC<UsernameRegistrationProps> = ({
</View>
</View>
)}

<View style={{ marginTop: 20 }}>
<Button
disabled={Boolean(inputError)}
Expand Down
4 changes: 0 additions & 4 deletions packages/mobile/src/setupTests.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,6 @@ jest.mock('react-native-mathjax-html-to-svg', () => { })

jest.mock('react-native-qrcode-svg', () => jest.fn())

jest.mock('react-native-progress', () => ({
CircleSnail: jest.fn(),
}))

jest.mock(
'@ronradtke/react-native-markdown-display', () => ({
__esModule: true,
Expand Down

0 comments on commit 68238f4

Please sign in to comment.