Commit 742760d1 authored by tom's avatar tom

tests

parent 31c0bfbd
...@@ -36,7 +36,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -36,7 +36,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
<Grid <Grid
gridTemplateColumns={{ gridTemplateColumns={{
lg: columnNum === 2 ? '3fr minmax(auto, 160px)' : '3fr minmax(auto, 160px) 150px', lg: columnNum === 2 ? '3fr minmax(auto, 160px)' : '3fr minmax(auto, 160px) 150px',
xl: columnNum === 2 ? '3fr minmax(auto, 250px)' : '3fr minmax(auto, 250px) 150px', xl: columnNum === 2 ? '3fr minmax(auto, 250px)' : '3fr minmax(auto, 275px) 150px',
}} }}
gridGap={ 8 } gridGap={ 8 }
width="100%" width="100%"
...@@ -110,15 +110,15 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -110,15 +110,15 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
) } ) }
</Flex> </Flex>
</Flex> </Flex>
<Box> <Flex flexDir="column">
{ !config.UI.views.tx.hiddenFields?.value && ( { !config.UI.views.tx.hiddenFields?.value && (
<Skeleton isLoaded={ !isLoading } mb="1px" lineHeight="30px"> <Skeleton isLoaded={ !isLoading } my="3px">
<Text as="span" whiteSpace="pre">{ config.chain.currency.symbol } </Text> <Text as="span" whiteSpace="pre">{ config.chain.currency.symbol } </Text>
<Text as="span" variant="secondary">{ getValueWithUnit(tx.value).dp(5).toFormat() }</Text> <Text as="span" variant="secondary">{ getValueWithUnit(tx.value).dp(5).toFormat() }</Text>
</Skeleton> </Skeleton>
) } ) }
{ !config.UI.views.tx.hiddenFields?.tx_fee && ( { !config.UI.views.tx.hiddenFields?.tx_fee && (
<Skeleton isLoaded={ !isLoading } display="flex" whiteSpace="pre" lineHeight="30px"> <Skeleton isLoaded={ !isLoading } display="flex" whiteSpace="pre" my="3px">
<Text as="span">Fee </Text> <Text as="span">Fee </Text>
{ tx.stability_fee ? ( { tx.stability_fee ? (
<TxFeeStability data={ tx.stability_fee } accuracy={ 5 } color="text_secondary" hideUsd/> <TxFeeStability data={ tx.stability_fee } accuracy={ 5 } color="text_secondary" hideUsd/>
...@@ -127,7 +127,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => { ...@@ -127,7 +127,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
) } ) }
</Skeleton> </Skeleton>
) } ) }
</Box> </Flex>
</Grid> </Grid>
); );
}; };
......
import { Box } from '@chakra-ui/react';
import { test, expect } from '@playwright/experimental-ct-react'; import { test, expect } from '@playwright/experimental-ct-react';
import React from 'react'; import React from 'react';
import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import * as addressMock from 'mocks/address/address'; import * as addressMock from 'mocks/address/address';
import TestApp from 'playwright/TestApp'; import TestApp from 'playwright/TestApp';
...@@ -127,9 +129,13 @@ test('customization', async({ mount }) => { ...@@ -127,9 +129,13 @@ test('customization', async({ mount }) => {
test('hover', async({ page, mount }) => { test('hover', async({ page, mount }) => {
const component = await mount( const component = await mount(
<TestApp> <TestApp>
<AddressEntity <AddressHighlightProvider>
address={ addressMock.withoutName } <Box p={ 3 }>
/> <AddressEntity
address={ addressMock.withoutName }
/>
</Box>
</AddressHighlightProvider>
</TestApp>, </TestApp>,
); );
......
...@@ -17,6 +17,8 @@ test.describe('base view', () => { ...@@ -17,6 +17,8 @@ test.describe('base view', () => {
</TestApp>, </TestApp>,
); );
await component.getByText('0x04').first().hover();
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
...@@ -31,6 +33,8 @@ test.describe('base view', () => { ...@@ -31,6 +33,8 @@ test.describe('base view', () => {
</TestApp>, </TestApp>,
); );
await component.getByText('0x04').first().hover();
await expect(component).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
}); });
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment