-
Notifications
You must be signed in to change notification settings - Fork 100
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
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ 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
... and 15 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
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() | ||
}) | ||
|
There was a problem hiding this comment.
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
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) | ||
}) | ||
|
There was a problem hiding this comment.
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
@@ -597,7 +575,7 @@ describe('TransactionFeedV2', () => { | |||
crossChainFeeAmount: '0.5', | |||
crossChainFeeAmountUsd: 500, | |||
}) | |||
expect(AppAnalytics.track).toBeCalledTimes(1) | |||
expect(AppAnalytics.track).toBeCalledTimes(2) |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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) => { |
There was a problem hiding this comment.
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.
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: