Skip to content

Commit

Permalink
chore(cleanup): Remove show_cash_in_token_filters feature gate (#6343)
Browse files Browse the repository at this point in the history
### Description

Confirmed with product that we should remove

### Test plan

CI

### Related issues

- Part of ACT-1443

### Backwards compatibility

Yes
### Network scalability

If a new NetworkId and/or Network are added in the future, the changes
in this PR will:

- N/A
  • Loading branch information
finnian0826 authored Dec 9, 2024
1 parent 35133b3 commit ff027e2
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 45 deletions.
52 changes: 12 additions & 40 deletions src/fiatExchanges/FiatExchangeCurrencyBottomSheet.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,28 +148,19 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
})
})

it.each([
{ flow: FiatExchangeFlow.CashIn, gate: false },
{ flow: FiatExchangeFlow.CashOut, gate: true },
{ flow: FiatExchangeFlow.Spend, gate: true },
])(`does not show filters for $flow when gate is $gate`, ({ flow, gate }) => {
jest
.mocked(getFeatureGate)
.mockImplementation(
(feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS && gate
it.each([{ flow: FiatExchangeFlow.CashOut }, { flow: FiatExchangeFlow.Spend }])(
`does not show filters for $flow`,
({ flow }) => {
const { queryByTestId } = render(
<Provider store={mockStore}>
<MockedNavigator component={FiatExchangeCurrencyBottomSheet} params={{ flow }} />
</Provider>
)
const { queryByTestId } = render(
<Provider store={mockStore}>
<MockedNavigator component={FiatExchangeCurrencyBottomSheet} params={{ flow }} />
</Provider>
)
expect(queryByTestId('FilterChipsCarousel')).toBeFalsy()
})
expect(queryByTestId('FilterChipsCarousel')).toBeFalsy()
}
)

it('shows filters for cash in when gate is true', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
it('shows filters for cash in', () => {
const { getByTestId, getByText } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand All @@ -188,11 +179,7 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
it('hides the popular filter for UK compliance', () => {
jest
.mocked(getFeatureGate)
.mockImplementation(
(feature) =>
feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS ||
feature === StatsigFeatureGates.SHOW_UK_COMPLIANT_VARIANT
)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_UK_COMPLIANT_VARIANT)
const { queryByText, getByText } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand All @@ -209,9 +196,6 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
})

it('popular filter filters correctly', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
const { getAllByTestId, getByText } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand All @@ -230,9 +214,6 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
})

it('stablecoin filter filters correctly', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
const { getAllByTestId, getByText } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand All @@ -251,9 +232,6 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
})

it('gas tokens filter filters correctly', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
const { getAllByTestId, getByText } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand All @@ -272,9 +250,6 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
})

it('network filter filters correctly', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
const { getAllByTestId, getByText } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand Down Expand Up @@ -305,9 +280,6 @@ describe(FiatExchangeCurrencyBottomSheet, () => {
})

it('allows a network to be pre-selected', () => {
jest
.mocked(getFeatureGate)
.mockImplementation((feature) => feature === StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
const { getAllByTestId } = render(
<Provider store={mockStore}>
<MockedNavigator
Expand Down
5 changes: 1 addition & 4 deletions src/fiatExchanges/FiatExchangeCurrencyBottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ function useFilterChips(

const showUKCompliantVariant = getFeatureGate(StatsigFeatureGates.SHOW_UK_COMPLIANT_VARIANT)

if (
flow !== FiatExchangeFlow.CashIn ||
!getFeatureGate(StatsigFeatureGates.SHOW_CASH_IN_TOKEN_FILTERS)
) {
if (flow !== FiatExchangeFlow.CashIn) {
return []
}
const supportedNetworkIds = getMultichainFeatures().showCico
Expand Down
1 change: 0 additions & 1 deletion src/statsig/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ export enum StatsigFeatureGates {
SHOW_JUMPSTART_SEND = 'show_jumpstart_send',
SHOW_POINTS = 'show_points',
SUBSIDIZE_STABLECOIN_EARN_GAS_FEES = 'subsidize_stablecoin_earn_gas_fees',
SHOW_CASH_IN_TOKEN_FILTERS = 'show_cash_in_token_filters',
ALLOW_CROSS_CHAIN_SWAPS = 'allow_cross_chain_swaps',
SHOW_UK_COMPLIANT_VARIANT = 'show_uk_compliant_variant',
ALLOW_EARN_PARTIAL_WITHDRAWAL = 'allow_earn_partial_withdrawal',
Expand Down

0 comments on commit ff027e2

Please sign in to comment.