-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Failing test of deep links on search results
- Loading branch information
Showing
2 changed files
with
93 additions
and
1 deletion.
There are no files selected for viewing
59 changes: 59 additions & 0 deletions
59
src/app/pages/SearchResultsPage/__tests__/SearchResultsView.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
import { screen } from '@testing-library/react' | ||
import { renderWithProviders } from '../../../utils/renderWithProviders' | ||
import { SearchResultsView } from '../' | ||
import { suggestedParsedAccount, suggestedParsedBlock } from '../../../utils/test-fixtures' | ||
|
||
describe('SearchResultsView', () => { | ||
beforeEach(() => { | ||
jest.useFakeTimers() | ||
jest.setSystemTime(new Date(2023, 1, 1)) | ||
}) | ||
|
||
afterEach(() => { | ||
jest.useRealTimers() | ||
}) | ||
|
||
it.todo('unskip tests') // TODO: fix deep links | ||
it.skip('block should correctly link to transactions', () => { | ||
renderWithProviders( | ||
<SearchResultsView | ||
searchQueries={{ | ||
emeraldBlockHeight: { | ||
isLoading: false, | ||
results: [suggestedParsedBlock], | ||
}, | ||
emeraldTxHash: { isLoading: false, results: [] }, | ||
consensusAccount: { isLoading: false, results: [] }, | ||
evmBech32Account: { isLoading: false, results: [] }, | ||
}} | ||
roseFiatValue={1} | ||
/>, | ||
) | ||
expect(screen.getByText('1,396,255')).toBeInTheDocument() | ||
expect(screen.getByRole('link', { name: '10 transactions' })).toBeInTheDocument() | ||
expect(screen.getByRole('link', { name: '10 transactions' })).toHaveAttribute( | ||
'href', | ||
'/emerald/blocks/1396255#transactions', | ||
) | ||
}) | ||
|
||
it.skip('account should correctly link to erc-20 tokens', () => { | ||
renderWithProviders( | ||
<SearchResultsView | ||
searchQueries={{ | ||
emeraldBlockHeight: { isLoading: false, results: [] }, | ||
emeraldTxHash: { isLoading: false, results: [] }, | ||
consensusAccount: { isLoading: false, results: [] }, | ||
evmBech32Account: { isLoading: false, results: [suggestedParsedAccount] }, | ||
}} | ||
roseFiatValue={1} | ||
/>, | ||
) | ||
expect(screen.getByText('EVM tokens')).toBeInTheDocument() | ||
expect(screen.getByRole('link', { name: '337325.43837 FTP' })).toBeInTheDocument() | ||
expect(screen.getByRole('link', { name: '337325.43837 FTP' })).toHaveAttribute( | ||
'href', | ||
'/emerald/account/0xBA504818FdD8D3dBA2Ef8fD9B4F4D5c71aD1d1D3/tokens/erc-20#oasis1qpssvkplnlpzdvwxpgmrhf9j5lkyvaylcvujhjhg', | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters