fix: console-lite e2e tests (#1576)

This commit is contained in:
Radosław Szpiech 2022-09-30 16:51:41 +02:00 committed by GitHub
parent 9a88c33458
commit efcd128240
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 6 deletions

View File

@ -299,7 +299,7 @@ describe('Market trade', { tags: '@smoke' }, () => {
cy.getByTestId('place-order').click(); cy.getByTestId('place-order').click();
cy.getByTestId('dialog-title').should( cy.getByTestId('dialog-title').should(
'have.text', 'have.text',
'Confirm transaction in wallet' 'Awaiting network confirmation'
); );
} }
}); });

View File

@ -41,8 +41,12 @@ const useAccountColumnDefinitions = () => {
valueFormatter: ({ valueFormatter: ({
value, value,
data, data,
}: VegaValueFormatterParams<AccountFields, 'deposited'>) => }: VegaValueFormatterParams<AccountFields, 'deposited'>) => {
addDecimalsFormatNumber(value, data.asset.decimals), if (value && data) {
return addDecimalsFormatNumber(value, data.asset.decimals);
}
return '-';
},
}, },
{ {
colId: 'used', colId: 'used',
@ -52,8 +56,12 @@ const useAccountColumnDefinitions = () => {
valueFormatter: ({ valueFormatter: ({
value, value,
data, data,
}: VegaValueFormatterParams<AccountFields, 'used'>) => }: VegaValueFormatterParams<AccountFields, 'used'>) => {
addDecimalsFormatNumber(value, data.asset.decimals), if (value && data) {
return addDecimalsFormatNumber(value, data.asset.decimals);
}
return '-';
},
}, },
]; ];
}, [open]); }, [open]);

View File

@ -20,7 +20,10 @@ function isAccount(
| AccountFieldsFragment | AccountFieldsFragment
| IterableElement<AccountEventsSubscription['accounts']> | IterableElement<AccountEventsSubscription['accounts']>
): account is AccountFieldsFragment { ): account is AccountFieldsFragment {
return (account as AccountFieldsFragment).__typename === 'Account'; return (
(account as AccountFieldsFragment).__typename === 'Account' ||
Boolean((account as AccountFieldsFragment).asset?.id)
);
} }
export const getId = ( export const getId = (