Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e - improve tests #461

Merged
merged 5 commits into from
Aug 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import * as React from 'react'
import { View } from 'react-native'
import Spinner from 'react-native-loading-spinner-overlay'
import { tailwind } from '../../tailwind'
import { translate } from '../../translations'
import { tailwind } from '../tailwind'
import { translate } from '../translations'

export default function LoadingScreen (props: { message?: string }): JSX.Element {
const { message } = props
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ import { Logging } from '../../../../api'
import { Text, TextInput, View } from '../../../../components'
import { Button } from '../../../../components/Button'
import { getTokenIcon } from '../../../../components/icons/tokens/_index'
import LoadingScreen from '../../../../components/LoadingScreen'
import { SectionTitle } from '../../../../components/SectionTitle'
import { AmountButtonTypes, SetAmountButton } from '../../../../components/SetAmountButton'
import { useTokensAPI } from '../../../../hooks/wallet/TokensAPI'
import { RootState } from '../../../../store'
import { hasTxQueued, transactionQueue } from '../../../../store/transaction'
import { tailwind } from '../../../../tailwind'
import { translate } from '../../../../translations'
import LoadingScreen from '../../../LoadingNavigator/LoadingScreen'
import { BalanceParamList } from './BalancesNavigator'

export type ConversionMode = 'utxosToAccount' | 'accountToUtxos'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,13 @@ export function TokenDetailScreen ({ route, navigation }: Props): JSX.Element {
</Text>
<NumberFormat
value={token.amount} decimalScale={8} thousandSeparator displayType='text' suffix={` ${token.symbol}`}
renderText={(value) => <Text style={tailwind('text-2xl font-bold')}>{value}</Text>}
renderText={(value) => (
<Text
testID='token_detail_amount'
style={tailwind('text-2xl font-bold')}
>{value}
</Text>
)}
/>
</View>
<SectionTitle
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion app/screens/AppNavigator/screens/Dex/DexAddLiquidity.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ import NumberFormat from 'react-number-format'
import { Text, TextInput, View } from '../../../../components'
import { Button } from '../../../../components/Button'
import { getTokenIcon } from '../../../../components/icons/tokens/_index'
import LoadingScreen from '../../../../components/LoadingScreen'
import { SectionTitle } from '../../../../components/SectionTitle'
import { AmountButtonTypes, SetAmountButton } from '../../../../components/SetAmountButton'
import { useTokensAPI } from '../../../../hooks/wallet/TokensAPI'
import { tailwind } from '../../../../tailwind'
import { translate } from '../../../../translations'
import LoadingScreen from '../../../LoadingNavigator/LoadingScreen'
import { DexParamList } from './DexNavigator'

type Props = StackScreenProps<DexParamList, 'AddLiquidity'>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import { Logging } from '../../../../../api'
import { Text, TextInput } from '../../../../../components'
import { Button } from '../../../../../components/Button'
import { getTokenIcon } from '../../../../../components/icons/tokens/_index'
import LoadingScreen from '../../../../../components/LoadingScreen'
import { SectionTitle } from '../../../../../components/SectionTitle'
import { AmountButtonTypes, SetAmountButton } from '../../../../../components/SetAmountButton'
import { useWallet } from '../../../../../contexts/WalletContext'
Expand All @@ -22,7 +23,6 @@ import { RootState } from '../../../../../store'
import { hasTxQueued, transactionQueue } from '../../../../../store/transaction_queue'
import { tailwind } from '../../../../../tailwind'
import { translate } from '../../../../../translations'
import LoadingScreen from '../../../../LoadingNavigator/LoadingScreen'
import { DexParamList } from '../DexNavigator'

interface DerivedTokenState {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { fireEvent, render } from "@testing-library/react-native"
import * as React from 'react'
import { Linking } from 'react-native'
import { AboutScreen } from "./AboutScreen";

it('<AboutScreen /> should match snapshot', async () => {
const tree = render(<AboutScreen />)
expect(tree.toJSON()).toMatchSnapshot()
const privacyPolicy = await tree.findByTestId('privacy_policy_button')
fireEvent.press(privacyPolicy)
expect(Linking.canOpenURL).toBeCalled()
})

Loading