Skip to content

Commit

Permalink
feat(home): remove cash in bottom sheet (#5071)
Browse files Browse the repository at this point in the history
### Description

Confirmed with product that this is no longer required.

### Test plan

Unit tests, CI

### Related issues

- Part of ACT-1105

### Backwards compatibility

Yes

### Network scalability

N/A
  • Loading branch information
satish-ravi committed Mar 12, 2024
1 parent 755eb68 commit 61de081
Show file tree
Hide file tree
Showing 22 changed files with 22 additions and 629 deletions.
8 changes: 1 addition & 7 deletions e2e/src/usecases/Assets.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import { generateMnemonic } from '@celo/cryptographic-utils'
import { DEFAULT_RECIPIENT_ADDRESS, SAMPLE_BACKUP_KEY } from '../utils/consts'
import { launchApp } from '../utils/retries'
import {
quickOnboarding,
waitForElementByIdAndTap,
waitForElementId,
dismissCashInBottomSheet,
} from '../utils/utils'
import { quickOnboarding, waitForElementByIdAndTap, waitForElementId } from '../utils/utils'

async function validateSendFlow(tokenSymbol) {
// navigate to send amount screen to ensure the expected token symbol is pre-selected
Expand Down Expand Up @@ -86,7 +81,6 @@ export default Assets = () => {
mnemonic = await generateMnemonic()
}
await quickOnboarding(mnemonic)
await dismissCashInBottomSheet()
})

it('navigates to Assets screen from home', async () => {
Expand Down
2 changes: 0 additions & 2 deletions e2e/src/usecases/FiatConnectTransferOut.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import fetch from 'node-fetch'
import { MOCK_PROVIDER_API_KEY, MOCK_PROVIDER_BASE_URL } from 'react-native-dotenv'
import { SAMPLE_PRIVATE_KEY } from '../utils/consts'
import {
dismissCashInBottomSheet,
enterPinUiIfNecessary,
fundWallet,
quickOnboarding,
Expand Down Expand Up @@ -63,7 +62,6 @@ async function submitTransfer(expectZeroBalance = false) {

// WalletHome
if (expectZeroBalance) {
await dismissCashInBottomSheet()
}
await expect(element(by.id('HomeAction-Send'))).toBeVisible() // proxy for reaching home screen, imitating NewAccountOnboarding e2e test
}
Expand Down
3 changes: 0 additions & 3 deletions e2e/src/usecases/NewAccountOnboarding.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { EXAMPLE_NAME } from '../utils/consts'
import { launchApp } from '../utils/retries'
import {
completeProtectWalletScreen,
dismissCashInBottomSheet,
enterPinUi,
quickOnboarding,
scrollIntoView,
Expand All @@ -28,7 +27,6 @@ const quickEducation = async () => {

const arriveAtHomeScreen = async () => {
// Arrived to Home screen
await dismissCashInBottomSheet()
await expect(element(by.id('HomeAction-Send'))).toBeVisible()
}

Expand Down Expand Up @@ -117,7 +115,6 @@ export default NewAccountOnboarding = () => {
.withTimeout(10 * 1000)

// Navigated to Home screen
await dismissCashInBottomSheet()
await waitFor(element(by.id('HomeAction-Send')))
.toBeVisible()
.withTimeout(10 * 1000)
Expand Down
2 changes: 0 additions & 2 deletions e2e/src/usecases/NewAccountPhoneVerification.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import { EXAMPLE_NAME, EXAMPLE_PHONE_NUMBER } from '../utils/consts'
import { launchApp } from '../utils/retries'
import { checkBalance, receiveSms } from '../utils/twilio'
import {
dismissCashInBottomSheet,
enterPinUi,
scrollIntoView,
sleep,
Expand Down Expand Up @@ -179,7 +178,6 @@ export default NewAccountPhoneVerification = () => {
await element(by.text('Skip')).tap()

// Assert we've arrived at the home screen
await dismissCashInBottomSheet()
await waitForElementId('HomeAction-Send')

// Assert that 'Connect phone number' is present in settings
Expand Down
4 changes: 1 addition & 3 deletions e2e/src/utils/retries.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { retry } from 'ts-retry-promise'
import { dismissCashInBottomSheet } from './utils'

export const launchApp = async (
launchArgs = {
Expand All @@ -25,7 +24,7 @@ export const launchApp = async (
})
}

export const reloadReactNative = async (dismissBottomSheet = true) => {
export const reloadReactNative = async () => {
await retry(
async () => {
try {
Expand All @@ -38,5 +37,4 @@ export const reloadReactNative = async (dismissBottomSheet = true) => {
},
{ retries: 5, delay: 10 * 1000, timeout: 30 * 10000 }
)
if (dismissBottomSheet) await dismissCashInBottomSheet()
}
10 changes: 0 additions & 10 deletions e2e/src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,6 @@ export async function quickOnboarding(mnemonic = SAMPLE_BACKUP_KEY) {
}

// Assert on Wallet Home Screen
await dismissCashInBottomSheet()
await expect(element(by.id('HomeAction-Send'))).toBeVisible()
} catch {} // Don't throw an error just silently continue
}
Expand Down Expand Up @@ -350,15 +349,6 @@ export async function confirmTransaction(commentText) {
}
}

export async function dismissCashInBottomSheet() {
try {
await waitFor(element(by.id('CashInBottomSheet')))
.toBeVisible()
.withTimeout(15 * 1000)
await element(by.id('DismissBottomSheet')).tap()
} catch {}
}

export async function waitForElementByText(text, timeout = 30_000, index = 0) {
try {
index === 0
Expand Down
3 changes: 0 additions & 3 deletions src/app/reducers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ interface State {
googleMobileServicesAvailable?: boolean
huaweiMobileServicesAvailable?: boolean
pincodeUseExpandedBlocklist: boolean
rampCashInButtonExpEnabled: boolean
sentryTracesSampleRate: number
sentryNetworkErrors: string[]
supportedBiometryType: BIOMETRY_TYPE | null
Expand Down Expand Up @@ -81,7 +80,6 @@ const initialState = {
googleMobileServicesAvailable: undefined,
huaweiMobileServicesAvailable: undefined,
pincodeUseExpandedBlocklist: REMOTE_CONFIG_VALUES_DEFAULTS.pincodeUseExpandedBlocklist,
rampCashInButtonExpEnabled: REMOTE_CONFIG_VALUES_DEFAULTS.rampCashInButtonExpEnabled,
sentryTracesSampleRate: REMOTE_CONFIG_VALUES_DEFAULTS.sentryTracesSampleRate,
sentryNetworkErrors: REMOTE_CONFIG_VALUES_DEFAULTS.sentryNetworkErrors.split(','),
supportedBiometryType: null,
Expand Down Expand Up @@ -204,7 +202,6 @@ export const appReducer = (
superchargeTokenConfigByToken: action.configValues.superchargeTokenConfigByToken,
logPhoneNumberTypeEnabled: action.configValues.logPhoneNumberTypeEnabled,
pincodeUseExpandedBlocklist: action.configValues.pincodeUseExpandedBlocklist,
rampCashInButtonExpEnabled: action.configValues.rampCashInButtonExpEnabled,
sentryTracesSampleRate: action.configValues.sentryTracesSampleRate,
sentryNetworkErrors: action.configValues.sentryNetworkErrors,
skipVerification: action.configValues.skipVerification,
Expand Down
1 change: 0 additions & 1 deletion src/app/saga.ts
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,6 @@ export interface RemoteConfigValues {
superchargeApy: number
superchargeTokenConfigByToken: SuperchargeTokenConfigByToken
pincodeUseExpandedBlocklist: boolean
rampCashInButtonExpEnabled: boolean
allowOtaTranslations: boolean
sentryTracesSampleRate: number
sentryNetworkErrors: string[]
Expand Down
1 change: 0 additions & 1 deletion src/firebase/firebase.ts
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,6 @@ export async function fetchRemoteConfigValues(): Promise<RemoteConfigValues | nu
? JSON.parse(superchargeConfigByTokenString)
: {},
pincodeUseExpandedBlocklist: flags.pincodeUseExpandedBlocklist.asBoolean(),
rampCashInButtonExpEnabled: flags.rampCashInButtonExpEnabled.asBoolean(),
logPhoneNumberTypeEnabled: flags.logPhoneNumberTypeEnabled.asBoolean(),
allowOtaTranslations: flags.allowOtaTranslations.asBoolean(),
sentryTracesSampleRate: flags.sentryTracesSampleRate.asNumber(),
Expand Down
1 change: 0 additions & 1 deletion src/firebase/remoteConfigValuesDefaults.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export const REMOTE_CONFIG_VALUES_DEFAULTS: Omit<
superchargecREALMin: 50,
superchargecREALMax: 6000,
pincodeUseExpandedBlocklist: true,
rampCashInButtonExpEnabled: false,
logPhoneNumberTypeEnabled: false,
allowOtaTranslations: false,
sentryTracesSampleRate: 0.2,
Expand Down
1 change: 0 additions & 1 deletion src/firebase/remoteConfigValuesDefaults.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export const REMOTE_CONFIG_VALUES_DEFAULTS: Omit<
superchargecREALMin: 50,
superchargecREALMax: 6000,
pincodeUseExpandedBlocklist: false,
rampCashInButtonExpEnabled: false,
logPhoneNumberTypeEnabled: false,
allowOtaTranslations: false,
sentryTracesSampleRate: DEFAULT_SENTRY_TRACES_SAMPLE_RATE,
Expand Down
123 changes: 0 additions & 123 deletions src/home/CashInBottomSheet.test.tsx

This file was deleted.

0 comments on commit 61de081

Please sign in to comment.