Skip to content

Commit

Permalink
add test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxaleks committed Aug 6, 2024
1 parent 291210d commit 9fb08da
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions ui/tx/TxSubHeading.pw.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';

import type { AddressMetadataInfo, AddressMetadataTagApi } from 'types/api/addressMetadata';
import type { AddressParam } from 'types/api/addressParams';

import config from 'configs/app';
import { protocolTagWithMeta } from 'mocks/metadata/address';
Expand Down Expand Up @@ -64,6 +65,25 @@ test.describe('blockscout provider', () => {
await expect(component).toHaveScreenshot();
});

test('with interpretation and recipient ENS domain', async({ render, mockApiResponse }) => {
const txData = {
...txMock.base,
to: {
...txMock.base.to,
hash: (txInterpretation.data.summaries[0].summary_template_variables.to_address.value as AddressParam).hash,
ens_domain_name: 'duckduck.eth',
},
};
const txWithEnsQuery = {
data: txData,
isPlaceholderData: false,
isError: false,
} as TxQuery;
await mockApiResponse('tx_interpretation', txInterpretation, { pathParams: { hash } });
const component = await render(<TxSubHeading hash={ hash } hasTag={ false } txQuery={ txWithEnsQuery }/>);
await expect(component).toHaveScreenshot();
});

test('with interpretation and view all link +@mobile', async({ render, mockApiResponse }) => {
await mockApiResponse(
'tx_interpretation',
Expand Down
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 9fb08da

Please sign in to comment.