Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Sep 9, 2024
1 parent 22868e3 commit da36f62
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions ui/pages/AccountsLabelSearch.pw.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import React from 'react';

import type { AddressesMetadataSearchResult } from 'types/api/addresses';

import * as addressMocks from 'mocks/address/address';
import { test, expect } from 'playwright/lib';

import AccountsLabelSearch from './AccountsLabelSearch';

const addresses: AddressesMetadataSearchResult = {
items: [
{
...addressMocks.withName,
tx_count: '1',
coin_balance: '12345678901234567890000',
},
{
...addressMocks.token,
tx_count: '109123890123',
coin_balance: '22222345678901234567890000',
ens_domain_name: null,
},
{
...addressMocks.withoutName,
tx_count: '11',
coin_balance: '1000000000000000000',
},
{
...addressMocks.eoa,
tx_count: '420',
coin_balance: '123456',
},
],
next_page_params: null,
};

const hooksConfig = {
router: {
query: {
slug: 'euler-finance-exploit',
tagType: 'generic',
tagName: 'Euler finance exploit',
},
},
};

test('base view +@mobile', async({ render, mockTextAd, mockApiResponse }) => {
await mockTextAd();
await mockApiResponse(
'addresses_metadata_search',
addresses,
{
queryParams: {
slug: 'euler-finance-exploit',
tag_type: 'generic',
},
},
);
const component = await render(<AccountsLabelSearch/>, { hooksConfig });
await expect(component).toHaveScreenshot();
});
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit da36f62

Please sign in to comment.