Commit 3d95b092 authored by tom's avatar tom

fix tests

parent 5f34ce71
...@@ -49,7 +49,7 @@ const Home = () => { ...@@ -49,7 +49,7 @@ const Home = () => {
</Box> </Box>
<Stats/> <Stats/>
<ChainIndicators/> <ChainIndicators/>
<AdBanner mt={{ base: 6, lg: 8 }} mx="auto"/> <AdBanner mt={{ base: 6, lg: 8 }} mx="auto" display="flex" justifyContent="center"/>
<Flex mt={ 8 } direction={{ base: 'column', lg: 'row' }} columnGap={ 12 } rowGap={ 8 }> <Flex mt={ 8 } direction={{ base: 'column', lg: 'row' }} columnGap={ 12 } rowGap={ 8 }>
<LatestBlocks/> <LatestBlocks/>
<Box flexGrow={ 1 }> <Box flexGrow={ 1 }>
......
...@@ -67,7 +67,7 @@ test('base view', async({ mount, page, createSocket }) => { ...@@ -67,7 +67,7 @@ test('base view', async({ mount, page, createSocket }) => {
await insertAdPlaceholder(page); await insertAdPlaceholder(page);
await expect(component.locator('main')).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
test.describe('mobile', () => { test.describe('mobile', () => {
...@@ -86,6 +86,6 @@ test.describe('mobile', () => { ...@@ -86,6 +86,6 @@ test.describe('mobile', () => {
await insertAdPlaceholder(page); await insertAdPlaceholder(page);
await expect(component.locator('main')).toHaveScreenshot(); await expect(component).toHaveScreenshot();
}); });
}); });
...@@ -22,7 +22,7 @@ const DetailsSponsoredItem = ({ isLoading }: Props) => { ...@@ -22,7 +22,7 @@ const DetailsSponsoredItem = ({ isLoading }: Props) => {
if (isMobile) { if (isMobile) {
return ( return (
<GridItem mt={ 5 }> <GridItem mt={ 5 }>
<AdBanner mx="auto" isLoading={ isLoading }/> <AdBanner mx="auto" isLoading={ isLoading } display="flex" justifyContent="center"/>
</GridItem> </GridItem>
); );
} }
......
import { Box, Flex, Text, chakra, useColorModeValue, Skeleton } from '@chakra-ui/react'; import { Box, Flex, chakra, useColorModeValue, Skeleton } from '@chakra-ui/react';
import clamp from 'lodash/clamp'; import clamp from 'lodash/clamp';
import React from 'react'; import React from 'react';
...@@ -18,13 +18,15 @@ const Utilization = ({ className, value, colorScheme = 'green', isLoading }: Pro ...@@ -18,13 +18,15 @@ const Utilization = ({ className, value, colorScheme = 'green', isLoading }: Pro
return ( return (
<Flex className={ className } alignItems="center" columnGap="10px"> <Flex className={ className } alignItems="center" columnGap="10px">
<Skeleton isLoaded={ !isLoading }> <Skeleton isLoaded={ !isLoading } w={ `${ WIDTH }px` } h="4px" borderRadius="full" overflow="hidden">
<Box bg={ useColorModeValue('blackAlpha.200', 'whiteAlpha.200') } w={ `${ WIDTH }px` } h="4px" borderRadius="full" overflow="hidden"> <Box bg={ useColorModeValue('blackAlpha.200', 'whiteAlpha.200') } h="100%">
<Box bg={ color } w={ valueString } h="100%"/> <Box bg={ color } w={ valueString } h="100%"/>
</Box> </Box>
</Skeleton> </Skeleton>
<Skeleton isLoaded={ !isLoading }> <Skeleton isLoaded={ !isLoading } color={ color } fontWeight="bold">
<Text color={ color } fontWeight="bold">{ valueString }</Text> <span>
{ valueString }
</span>
</Skeleton> </Skeleton>
</Flex> </Flex>
); );
......
...@@ -40,15 +40,16 @@ const NFTItem = ({ item, isLoading }: Props) => { ...@@ -40,15 +40,16 @@ const NFTItem = ({ item, isLoading }: Props) => {
<Flex mb={ 2 } ml={ 1 }> <Flex mb={ 2 } ml={ 1 }>
<Text whiteSpace="pre" variant="secondary">ID# </Text> <Text whiteSpace="pre" variant="secondary">ID# </Text>
<TruncatedTextTooltip label={ item.id }> <TruncatedTextTooltip label={ item.id }>
<Skeleton isLoaded={ !isLoading } overflow="hidden">
<LinkInternal <LinkInternal
overflow="hidden" overflow="hidden"
whiteSpace="nowrap"
textOverflow="ellipsis" textOverflow="ellipsis"
whiteSpace="nowrap"
display="block"
> >
<Skeleton isLoaded={ !isLoading }>
{ item.id } { item.id }
</Skeleton>
</LinkInternal> </LinkInternal>
</Skeleton>
</TruncatedTextTooltip> </TruncatedTextTooltip>
</Flex> </Flex>
) } ) }
......
import { Text, Flex, Tag, Icon, useColorModeValue, Skeleton } from '@chakra-ui/react'; import { Text, Flex, Icon, useColorModeValue, Skeleton } from '@chakra-ui/react';
import BigNumber from 'bignumber.js'; import BigNumber from 'bignumber.js';
import React from 'react'; import React from 'react';
...@@ -11,6 +11,7 @@ import trimTokenSymbol from 'lib/token/trimTokenSymbol'; ...@@ -11,6 +11,7 @@ import trimTokenSymbol from 'lib/token/trimTokenSymbol';
import Address from 'ui/shared/address/Address'; import Address from 'ui/shared/address/Address';
import AddressIcon from 'ui/shared/address/AddressIcon'; import AddressIcon from 'ui/shared/address/AddressIcon';
import AddressLink from 'ui/shared/address/AddressLink'; import AddressLink from 'ui/shared/address/AddressLink';
import Tag from 'ui/shared/chakra/Tag';
import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile'; import ListItemMobile from 'ui/shared/ListItemMobile/ListItemMobile';
import TokenTransferNft from 'ui/shared/TokenTransfer/TokenTransferNft'; import TokenTransferNft from 'ui/shared/TokenTransfer/TokenTransferNft';
...@@ -63,12 +64,14 @@ const TokenTransferListItem = ({ ...@@ -63,12 +64,14 @@ const TokenTransferListItem = ({
{ timestamp && ( { timestamp && (
<Text variant="secondary" fontWeight="400" fontSize="sm"> <Text variant="secondary" fontWeight="400" fontSize="sm">
<Skeleton isLoaded={ !isLoading } display="inline-block"> <Skeleton isLoaded={ !isLoading } display="inline-block">
<span>
{ timeAgo } { timeAgo }
</span>
</Skeleton> </Skeleton>
</Text> </Text>
) } ) }
</Flex> </Flex>
{ method && <Skeleton isLoaded={ !isLoading } borderRadius="sm"><Tag colorScheme="gray">{ method }</Tag></Skeleton> } { method && <Tag isLoading={ isLoading }>{ method }</Tag> }
<Flex w="100%" columnGap={ 3 }> <Flex w="100%" columnGap={ 3 }>
<Address width="50%"> <Address width="50%">
<AddressIcon address={ from } isLoading={ isLoading }/> <AddressIcon address={ from } isLoading={ isLoading }/>
......
...@@ -44,15 +44,19 @@ const TokenTransferTableItem = ({ ...@@ -44,15 +44,19 @@ const TokenTransferTableItem = ({
</Address> </Address>
{ timestamp && ( { timestamp && (
<Skeleton isLoaded={ !isLoading } display="inline-block" color="gray.500" fontWeight="400" ml="10px"> <Skeleton isLoaded={ !isLoading } display="inline-block" color="gray.500" fontWeight="400" ml="10px">
<span>
{ timeAgo } { timeAgo }
</span>
</Skeleton> </Skeleton>
) } ) }
</Grid> </Grid>
</Td> </Td>
<Td> <Td>
{ method ? (
<Box my="3px"> <Box my="3px">
<Tag isLoading={ isLoading } isTruncated>{ method }</Tag> <Tag isLoading={ isLoading } isTruncated>{ method }</Tag>
</Box> </Box>
) : null }
</Td> </Td>
<Td> <Td>
<Address display="inline-flex" maxW="100%" py="3px"> <Address display="inline-flex" maxW="100%" py="3px">
......
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