Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
tom2drum committed Dec 27, 2023
1 parent 31c0bfb commit 742760d
Show file tree
Hide file tree
Showing 16 changed files with 18 additions and 8 deletions.
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.
10 changes: 5 additions & 5 deletions ui/home/LatestTxsItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
<Grid
gridTemplateColumns={{
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 }
width="100%"
Expand Down Expand Up @@ -110,15 +110,15 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
) }
</Flex>
</Flex>
<Box>
<Flex flexDir="column">
{ !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" variant="secondary">{ getValueWithUnit(tx.value).dp(5).toFormat() }</Text>
</Skeleton>
) }
{ !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>
{ tx.stability_fee ? (
<TxFeeStability data={ tx.stability_fee } accuracy={ 5 } color="text_secondary" hideUsd/>
Expand All @@ -127,7 +127,7 @@ const LatestTxsItem = ({ tx, isLoading }: Props) => {
) }
</Skeleton>
) }
</Box>
</Flex>
</Grid>
);
};
Expand Down
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.
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 9 additions & 3 deletions ui/shared/entities/address/AddressEntity.pw.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { Box } from '@chakra-ui/react';
import { test, expect } from '@playwright/experimental-ct-react';
import React from 'react';

import { AddressHighlightProvider } from 'lib/contexts/addressHighlight';
import * as addressMock from 'mocks/address/address';
import TestApp from 'playwright/TestApp';

Expand Down Expand Up @@ -127,9 +129,13 @@ test('customization', async({ mount }) => {
test('hover', async({ page, mount }) => {
const component = await mount(
<TestApp>
<AddressEntity
address={ addressMock.withoutName }
/>
<AddressHighlightProvider>
<Box p={ 3 }>
<AddressEntity
address={ addressMock.withoutName }
/>
</Box>
</AddressHighlightProvider>
</TestApp>,
);

Expand Down
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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions ui/txs/TxsTable.pw.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ test.describe('base view', () => {
</TestApp>,
);

await component.getByText('0x04').first().hover();

await expect(component).toHaveScreenshot();
});

Expand All @@ -31,6 +33,8 @@ test.describe('base view', () => {
</TestApp>,
);

await component.getByText('0x04').first().hover();

await expect(component).toHaveScreenshot();
});
});
Expand Down
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.
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 742760d

Please sign in to comment.