Skip to content

Commit

Permalink
Quick fix for test
Browse files Browse the repository at this point in the history
  • Loading branch information
georgewrmarshall committed Jun 19, 2023
1 parent e8074f0 commit 0fb6e19
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 20 deletions.
26 changes: 10 additions & 16 deletions ui/components/app/cancel-speedup-popover/cancel-speedup-popover.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import React, { useEffect } from 'react';
import { EditGasModes, PriorityLevels } from '../../../../shared/constants/gas';
import {
AlignItems,
DISPLAY,
FLEX_DIRECTION,
Display,
FlexDirection,
TextVariant,
} from '../../../helpers/constants/design-system';
import { getAppIsLoading } from '../../../selectors';
Expand Down Expand Up @@ -97,20 +97,14 @@ const CancelSpeedupPopover = () => {
<div className="cancel-speedup-popover__wrapper">
<Text
alignItems={AlignItems.center}
display={DISPLAY.FLEX}
display={Display.Flex}
variant={TextVariant.bodySm}
marginBottom={2}
paddingBottom={2}
className="cancel-speedup-popover__description"
>
{t('cancelSpeedUpLabel', [
<Text
as="strong"
variant={TextVariant.bodySm}
key="cancelSpeedupCancel"
>
{t('replace')}
</Text>,
<strong key="cancelSpeedupCancel">{t('replace')}</strong>,
])}
<InfoTooltip
position="top"
Expand All @@ -135,17 +129,17 @@ const CancelSpeedupPopover = () => {
/>
</Text>
<Box
display={DISPLAY.FLEX}
display={Display.Flex}
alignItems={AlignItems.center}
flexDirection={FLEX_DIRECTION.COLUMN}
flexDirection={FlexDirection.Column}
marginTop={2}
>
<Box className="cancel-speedup-popover__edit-gas-button">
<div className="cancel-speedup-popover__edit-gas-button">
{!appIsLoading && <EditGasFeeButton />}
</Box>
<Box className="cancel-speedup-popover__gas-details">
</div>
<div className="cancel-speedup-popover__gas-details">
<GasDetailsItem />
</Box>
</div>
</Box>
<Button onClick={submitTransactionChange}>{t('submit')}</Button>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,17 @@ describe('CancelSpeedupPopover', () => {
it('information tooltip should contain the correct text if editGasMode is cancel', async () => {
await act(async () => render());
expect(
InfoTooltip.mock.calls[0][0].contentText.props.children[0],
).toStrictEqual(
InfoTooltip.mock.calls[0][0].contentText.props.children[0].props.children,
).toEqual(
'To Cancel a transaction the gas fee must be increased by at least 10% for it to be recognized by the network.',
);
});

it('information tooltip should contain the correct text if editGasMode is speedup', async () => {
await act(async () => render({ editGasMode: EditGasModes.speedUp }));
expect(
InfoTooltip.mock.calls[0][0].contentText.props.children[0],
).toStrictEqual(
InfoTooltip.mock.calls[0][0].contentText.props.children[0].props.children,
).toEqual(
'To Speed up a transaction the gas fee must be increased by at least 10% for it to be recognized by the network.',
);
});
Expand Down

0 comments on commit 0fb6e19

Please sign in to comment.