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

chore(cleanup): Remove show_get_started feature gate #6300

Merged
merged 3 commits into from
Dec 6, 2024

Conversation

finnian0826
Copy link
Contributor

Description

Title

Test plan

CI

Related issues

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

Copy link

codecov bot commented Dec 4, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 89.01%. Comparing base (35dcd31) to head (41c1218).
Report is 21 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #6300      +/-   ##
==========================================
- Coverage   89.01%   89.01%   -0.01%     
==========================================
  Files         739      739              
  Lines       31610    31602       -8     
  Branches     5880     5878       -2     
==========================================
- Hits        28138    28130       -8     
  Misses       3427     3427              
  Partials       45       45              
Files with missing lines Coverage Δ
src/statsig/types.ts 100.00% <ø> (ø)
src/transactions/feed/TransactionFeed.tsx 76.13% <100.00%> (-0.79%) ⬇️
src/transactions/feed/TransactionFeedV2.tsx 88.14% <100.00%> (-0.05%) ⬇️

... and 15 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 35dcd31...41c1218. Read the comment docs.

Comment on lines -274 to -289
it('renders the loading indicator while it loads', async () => {
const { getByTestId, queryByTestId } = renderScreen({})
expect(getByTestId('NoActivity/loading')).toBeDefined()
expect(queryByTestId('NoActivity/error')).toBeNull()
expect(queryByTestId('TransactionList')).toBeNull()
})

it("renders an error screen if there's no cache and the query fails", async () => {
mockFetch.mockReject(new Error('Test error'))

const { getByTestId, queryByTestId } = renderScreen({})
await waitFor(() => getByTestId('NoActivity/error'))
expect(queryByTestId('NoActivity/loading')).toBeNull()
expect(queryByTestId('TransactionList')).toBeNull()
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests were for when the feature gate was turned off

Comment on lines -152 to -164
it("renders no transactions and an error message if there's no cache and the query fails", async () => {
mockFetch.mockReject(new Error('Test error'))
const tree = renderScreen()

expect(tree.queryByText('transactionFeed.error.fetchError')).toBeFalsy()
expect(tree.getByTestId('TransactionList/loading')).toBeTruthy()

await waitFor(() => expect(tree.getByText('transactionFeed.error.fetchError')).toBeTruthy())
expect(tree.queryByTestId('TransactionList/loading')).toBeNull()
expect(tree.getByText('transactionFeed.noTransactions')).toBeTruthy()
expect(tree.getByTestId('TransactionList').props.data).toHaveLength(0)
})

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test when feature gate was off

@finnian0826 finnian0826 marked this pull request as ready for review December 5, 2024 21:39
@@ -597,7 +575,7 @@ describe('TransactionFeedV2', () => {
crossChainFeeAmount: '0.5',
crossChainFeeAmountUsd: 500,
})
expect(AppAnalytics.track).toBeCalledTimes(1)
expect(AppAnalytics.track).toBeCalledTimes(2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this change expected? if so, can we assert or at least document why? Since we only assert on the swap event

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, a get started impression analytics event is firing since the get started component shows at the start of the test. Added an assertion for it.

@@ -236,17 +223,14 @@ describe('TransactionFeedV2', () => {
expect(tree.getByText('transactionFeed.allTransactionsShown')).toBeTruthy()
})

it('renders GetStarted if SHOW_GET_STARTED is enabled and transaction feed is empty', async () => {
it('renders GetStarted if transaction feed is empty', async () => {
mockFetch.mockResponse(
typedResponse({
transactions: [],
pageInfo: { hasNextPage: false, endCursor: '', hasPreviousPage: false, startCursor: '' },
})
)
jest.mocked(getFeatureGate).mockImplementation((gate) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these false mocks with a single gate seem unnecessary now given that a beforeEach resets them.

@finnian0826 finnian0826 added this pull request to the merge queue Dec 6, 2024
Merged via the queue into main with commit 9aa4ebc Dec 6, 2024
15 checks passed
@finnian0826 finnian0826 deleted the finnian0826/act-1443 branch December 6, 2024 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants