Fix: data test ids for price change and visual regression fixes (#511)

* fix: add data test ids for price change percentage

* fix: add data test id for dialog overlay
This commit is contained in:
m.ray 2022-06-13 13:40:28 +01:00 committed by GitHub
parent 554097e391
commit 5f8061d5ce
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -26,7 +26,7 @@ export const LandingDialog = ({ open, setOpen }: LandingDialogProps) => {
<AsyncRenderer loading={loading} error={error} data={data}>
<Dialog
title={t('Select a market to get started')}
intent={Intent.Warning}
intent={Intent.Primary}
open={open}
onChange={setClose}
titleClassNames="font-bold font-sans text-3xl tracking-tight mb-0 pl-8"

View File

@ -14,7 +14,7 @@ export const SelectMarketDialog = ({
return (
<Dialog
title={t('Select a market')}
intent={Intent.Warning}
intent={Intent.Primary}
open={dialogOpen}
onChange={() => setDialogOpen(false)}
titleClassNames="font-bold font-sans text-3xl tracking-tight mb-0 pl-8"

View File

@ -35,7 +35,10 @@ export function Dialog({
return (
<DialogPrimitives.Root open={open} onOpenChange={(x) => onChange(x)}>
<DialogPrimitives.Portal>
<DialogPrimitives.Overlay className="fixed inset-0 bg-black/50 z-10" />
<DialogPrimitives.Overlay
className="fixed inset-0 bg-black/50 z-10"
data-testid="dialog-overlay"
/>
<DialogPrimitives.Content className={contentClasses}>
<DialogPrimitives.Close
className="p-12 absolute top-0 right-0"

View File

@ -54,15 +54,15 @@ export const PriceCellChange = React.memo(
)} flex items-center gap-4 justify-end`}
>
<Arrow value={change} />
<span className="flex items-center gap-6 font-mono">
<span>
<span className="flex items-center gap-6 font-mono text-ui-small">
<span data-testid="price-change-percentage">
{formatNumberPercentage(
new BigNumber(changePercentage.toString()),
2
)}
&nbsp;
</span>
<span>
<span data-testid="price-change">
{addDecimalsFormatNumber(change.toString(), decimalPlaces ?? 0, 3)}
</span>
</span>