From fa6534a4bbed366f85b58e9703b8ac5c681b49e0 Mon Sep 17 00:00:00 2001 From: Enzo Vezzaro Date: Wed, 8 Jun 2022 08:41:42 -0400 Subject: [PATCH] adding missing args --- .../AssetComputeList/index.stories.tsx | 7 +++++-- .../AssetList/AssetListTitle/index.tsx | 2 +- .../@shared/AssetList/index.stories.tsx | 11 ++++++++-- .../@shared/AssetList/index.test.tsx | 11 ++++++++-- .../AssetSelection/index.stories.tsx | 21 +++++++++++++++---- src/components/Footer/MarketStats/index.tsx | 2 +- 6 files changed, 42 insertions(+), 12 deletions(-) diff --git a/src/components/@shared/AssetList/AssetComputeList/index.stories.tsx b/src/components/@shared/AssetList/AssetComputeList/index.stories.tsx index 056046da2..2b2d8ce02 100644 --- a/src/components/@shared/AssetList/AssetComputeList/index.stories.tsx +++ b/src/components/@shared/AssetList/AssetComputeList/index.stories.tsx @@ -5,7 +5,8 @@ import AssetComputeList, { } from '@shared/AssetList/AssetComputeList' import { assetSelectionAsset, - locale + locale, + prices } from '../../../../../.storybook/__mockdata__' export default { @@ -24,5 +25,7 @@ interface Props { export const Default: Props = Template.bind({}) Default.args = { assets: assetSelectionAsset, - locale: locale + locale, + currency: 'OCEAN', + prices } diff --git a/src/components/@shared/AssetList/AssetListTitle/index.tsx b/src/components/@shared/AssetList/AssetListTitle/index.tsx index 2c361b6b9..66c1ab058 100644 --- a/src/components/@shared/AssetList/AssetListTitle/index.tsx +++ b/src/components/@shared/AssetList/AssetListTitle/index.tsx @@ -21,7 +21,7 @@ export default function AssetListTitle({ const [assetTitle, setAssetTitle] = useState(title) useEffect(() => { - if (title || !appConfig || !appConfig.metadataCacheUri) return + if (title || !appConfig?.metadataCacheUri) return if (asset) { setAssetTitle(asset.metadata.name) return diff --git a/src/components/@shared/AssetList/index.stories.tsx b/src/components/@shared/AssetList/index.stories.tsx index 936c91e8e..c44016e30 100644 --- a/src/components/@shared/AssetList/index.stories.tsx +++ b/src/components/@shared/AssetList/index.stories.tsx @@ -2,7 +2,12 @@ import React from 'react' import { ComponentStory, ComponentMeta } from '@storybook/react' import AssetList, { AssetListProps } from '@shared/AssetList' import * as config from '../../../../app.config' -import { assets, locale, mockWallet } from '../../../../.storybook/__mockdata__' +import { + assets, + locale, + mockWallet, + prices +} from '../../../../.storybook/__mockdata__' import UrqlClientProvider from '@context/UrqlProvider' export default { @@ -28,5 +33,7 @@ Default.args = { assets, showPagination: false, chainIds: config.chainIds, - accountId: mockWallet + accountId: mockWallet, + currency: 'OCEAN', + prices } diff --git a/src/components/@shared/AssetList/index.test.tsx b/src/components/@shared/AssetList/index.test.tsx index 1d90f0034..7d9a2ec4d 100644 --- a/src/components/@shared/AssetList/index.test.tsx +++ b/src/components/@shared/AssetList/index.test.tsx @@ -1,6 +1,11 @@ import React from 'react' import { act, render } from '@testing-library/react' -import { assets, locale, mockWallet } from '../../../../.storybook/__mockdata__' +import { + assets, + locale, + mockWallet, + prices +} from '../../../../.storybook/__mockdata__' import * as config from '../../../../app.config' import AssetList from './' import UrqlClientProvider from '@context/UrqlProvider' @@ -11,7 +16,9 @@ test('render AssetList with arc', async () => { assets, showPagination: false, chainIds: config.chainIds, - accountId: mockWallet + accountId: mockWallet, + currency: 'OCEAN', + prices } // TODO: remove eslint rule (testing-library/no-unnecessary-act) and solve act issue // eslint-disable-next-line testing-library/no-unnecessary-act diff --git a/src/components/@shared/FormFields/AssetSelection/index.stories.tsx b/src/components/@shared/FormFields/AssetSelection/index.stories.tsx index f1943440d..837db036e 100644 --- a/src/components/@shared/FormFields/AssetSelection/index.stories.tsx +++ b/src/components/@shared/FormFields/AssetSelection/index.stories.tsx @@ -3,7 +3,11 @@ import { ComponentStory, ComponentMeta } from '@storybook/react' import AssetSelection, { AssetSelectionProps } from '@shared/FormFields/AssetSelection' -import { assetSelectionAsset } from '../../../../../.storybook/__mockdata__' +import { + assetSelectionAsset, + locale, + prices +} from '../../../../../.storybook/__mockdata__' export default { title: 'Component/@shared/FormFields/AssetSelection', @@ -20,17 +24,26 @@ interface Props { export const Default: Props = Template.bind({}) Default.args = { - assets: assetSelectionAsset + assets: assetSelectionAsset, + currency: 'OCEAN', + locale, + prices } export const Multiple: Props = Template.bind({}) Multiple.args = { assets: assetSelectionAsset, - multiple: true + multiple: true, + currency: 'OCEAN', + locale, + prices } export const Disabled: Props = Template.bind({}) Disabled.args = { assets: assetSelectionAsset, - disabled: true + disabled: true, + currency: 'OCEAN', + locale, + prices } diff --git a/src/components/Footer/MarketStats/index.tsx b/src/components/Footer/MarketStats/index.tsx index 10c050883..5be4ac0ba 100644 --- a/src/components/Footer/MarketStats/index.tsx +++ b/src/components/Footer/MarketStats/index.tsx @@ -46,7 +46,7 @@ export default function MarketStats(): ReactElement { // Set the main chain ids we want to display stats for // useEffect(() => { - if (!networksList || !appConfig || !appConfig?.chainIdsSupported) return + if (!networksList || !appConfig?.chainIdsSupported) return const mainChainIdsList = filterNetworksByType( 'mainnet',