-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add deploy page e2e tests #448
base: dev
Are you sure you want to change the base?
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,111 +37,116 @@ export const TransactionDetailsCard: React.FC<TransactionDetailsCardProps> = ({ | |
); | ||
|
||
return ( | ||
<InfoCardContentWrapper> | ||
<Card.Body> | ||
<HeadContentWrapper> | ||
<TransactionHeading type="h2"> | ||
{t('transaction-details')} | ||
</TransactionHeading> | ||
</HeadContentWrapper> | ||
<DetailDataWrapper> | ||
<TransactionGrid gap="2rem"> | ||
<DetailDataList gap="2rem"> | ||
{!!deploy?.amount && ( | ||
<div data-cy="transaction-details-card"> | ||
<InfoCardContentWrapper> | ||
<Card.Body> | ||
<HeadContentWrapper> | ||
<TransactionHeading type="h2"> | ||
{t('transaction-details')} | ||
</TransactionHeading> | ||
</HeadContentWrapper> | ||
<DetailDataWrapper> | ||
<TransactionGrid gap="2rem"> | ||
<DetailDataList gap="2rem"> | ||
{!!deploy?.amount && ( | ||
<li> | ||
<Grid gap="1rem" templateColumns="9rem auto"> | ||
<DetailDataLabel>{t('amount')}</DetailDataLabel> | ||
<DetailDataValue data-testid="deploy-amount"> | ||
<Coin>{deploy?.amount}</Coin> | ||
</DetailDataValue> | ||
</Grid> | ||
</li> | ||
)} | ||
<li> | ||
<Grid gap="1rem" templateColumns="9rem auto"> | ||
<DetailDataLabel>{t('amount')}</DetailDataLabel> | ||
<DetailDataValue data-testid="deploy-amount"> | ||
<Coin>{deploy?.amount}</Coin> | ||
<Grid gap="1rem" templateColumns="9rem 1fr"> | ||
<DetailDataLabel>{t('cost')}</DetailDataLabel> | ||
<DetailDataValue data-testid="deploy-cost"> | ||
{withSkeletonLoading( | ||
<Coin>{deploy?.cost ?? ''}</Coin>, | ||
isLoading, | ||
{}, | ||
)} | ||
</DetailDataValue> | ||
</Grid> | ||
</li> | ||
)} | ||
<li> | ||
<Grid gap="1rem" templateColumns="9rem 1fr"> | ||
<DetailDataLabel>{t('cost')}</DetailDataLabel> | ||
<DetailDataValue data-testid="deploy-cost"> | ||
{withSkeletonLoading( | ||
<Coin>{deploy?.cost ?? ''}</Coin>, | ||
isLoading, | ||
{}, | ||
)} | ||
</DetailDataValue> | ||
</Grid> | ||
</li> | ||
<li> | ||
<Grid gap="1rem" templateColumns="9rem 1fr"> | ||
<DetailDataLabel>{t('payment-amount')}</DetailDataLabel> | ||
<DetailDataValue data-testid="deploy-payment-amount"> | ||
{withSkeletonLoading( | ||
<Coin>{deploy?.paymentAmount ?? ''}</Coin>, | ||
isLoading, | ||
{}, | ||
)} | ||
</DetailDataValue> | ||
</Grid> | ||
</li> | ||
</DetailDataList> | ||
<Grid templateColumns="1fr 1fr" templateRows="1fr" gap="2rem 1rem"> | ||
<div> | ||
<DetailDataLabel>{t('timestamp')}</DetailDataLabel> | ||
<TransactionDetailData data-testid="readable-time-stamp"> | ||
{withSkeletonLoading( | ||
deploy?.readableTimestamp, | ||
isLoading, | ||
{}, | ||
)} | ||
</TransactionDetailData> | ||
</div> | ||
<HideOnMobile> | ||
<li> | ||
<Grid gap="1rem" templateColumns="9rem 1fr"> | ||
<DetailDataLabel>{t('payment-amount')}</DetailDataLabel> | ||
<DetailDataValue data-testid="deploy-payment-amount"> | ||
{withSkeletonLoading( | ||
<Coin>{deploy?.paymentAmount ?? ''}</Coin>, | ||
isLoading, | ||
{}, | ||
)} | ||
</DetailDataValue> | ||
</Grid> | ||
</li> | ||
</DetailDataList> | ||
<Grid | ||
templateColumns="1fr 1fr" | ||
templateRows="1fr" | ||
gap="2rem 1rem"> | ||
<div> | ||
<DetailDataLabel>{t('status')}</DetailDataLabel> | ||
<DeployStatusData data-testid="status"> | ||
<DetailDataLabel>{t('timestamp')}</DetailDataLabel> | ||
<TransactionDetailData data-testid="readable-time-stamp"> | ||
{withSkeletonLoading( | ||
<> | ||
{deploy?.status} | ||
<StatusIconWrapper>{statusIcon}</StatusIconWrapper> | ||
</>, | ||
deploy?.readableTimestamp, | ||
isLoading, | ||
{}, | ||
)} | ||
</DeployStatusData> | ||
</TransactionDetailData> | ||
Comment on lines
+91
to
+98
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we not care about status on desktop? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both screens will get status. One is show on HideOnMobile and the other on HideOnDesktop |
||
</div> | ||
</HideOnMobile> | ||
<HideOnDesktop> | ||
<SpanTwoCols> | ||
<DetailDataLabel>{t('status')}</DetailDataLabel> | ||
<DeployStatusData> | ||
{withSkeletonLoading( | ||
<> | ||
{deploy?.status} | ||
<StatusIconWrapper>{statusIcon}</StatusIconWrapper> | ||
</>, | ||
isLoading, | ||
{ width: 100 }, | ||
)} | ||
</DeployStatusData> | ||
</SpanTwoCols> | ||
</HideOnDesktop> | ||
<ActionAndDeployTypeWrapper> | ||
<DetailDataLabel>{t('action')}</DetailDataLabel> | ||
<TransactionDetailData data-testid="action"> | ||
{withSkeletonLoading(deploy?.action, isLoading, {})} | ||
</TransactionDetailData> | ||
</ActionAndDeployTypeWrapper> | ||
{!!deploy?.deployType && ( | ||
<HideOnMobile> | ||
<div> | ||
<DetailDataLabel>{t('status')}</DetailDataLabel> | ||
<DeployStatusData data-testid="status"> | ||
{withSkeletonLoading( | ||
<> | ||
{deploy?.status} | ||
<StatusIconWrapper>{statusIcon}</StatusIconWrapper> | ||
</>, | ||
isLoading, | ||
{}, | ||
)} | ||
</DeployStatusData> | ||
</div> | ||
</HideOnMobile> | ||
<HideOnDesktop> | ||
<SpanTwoCols> | ||
<DetailDataLabel>{t('status')}</DetailDataLabel> | ||
<DeployStatusData> | ||
{withSkeletonLoading( | ||
<> | ||
{deploy?.status} | ||
<StatusIconWrapper>{statusIcon}</StatusIconWrapper> | ||
</>, | ||
isLoading, | ||
{ width: 100 }, | ||
)} | ||
</DeployStatusData> | ||
</SpanTwoCols> | ||
</HideOnDesktop> | ||
<ActionAndDeployTypeWrapper> | ||
<DetailDataLabel>{t('deploy-type')}</DetailDataLabel> | ||
<TransactionDetailData data-testid="deploy-type"> | ||
{deploy?.deployType} | ||
<DetailDataLabel>{t('action')}</DetailDataLabel> | ||
<TransactionDetailData data-testid="action"> | ||
{withSkeletonLoading(deploy?.action, isLoading, {})} | ||
</TransactionDetailData> | ||
</ActionAndDeployTypeWrapper> | ||
)} | ||
</Grid> | ||
</TransactionGrid> | ||
</DetailDataWrapper> | ||
</Card.Body> | ||
</InfoCardContentWrapper> | ||
{!!deploy?.deployType && ( | ||
<ActionAndDeployTypeWrapper> | ||
<DetailDataLabel>{t('deploy-type')}</DetailDataLabel> | ||
<TransactionDetailData data-testid="deploy-type"> | ||
{deploy?.deployType} | ||
</TransactionDetailData> | ||
</ActionAndDeployTypeWrapper> | ||
)} | ||
</Grid> | ||
</TransactionGrid> | ||
</DetailDataWrapper> | ||
</Card.Body> | ||
</InfoCardContentWrapper> | ||
</div> | ||
); | ||
}; | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
export const mockDeploy = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please update this to a function that returns this object? We should get in the habit of only assigning variables for mocks this way. |
||
deployHash: | ||
'7e2cad6ae20875b6a3ffcbb4e743ab5e0fc0f8b5ecc444e222f0204a7ee9120f', | ||
truncatedDeployHash: '7e2ca...9120f', | ||
blockHash: 'b315d3b20eb2a9d14d2260a78494cada02108cc7d218c812ade3a173a48a15b5', | ||
truncatedBlockHash: 'b315d...a15b5', | ||
publicKey: | ||
'0203e6b3f236f340ea8d355bd438f5176ed1a2eea21c8d4d4de66c0ee96334de44f5', | ||
truncatedPublicKey: '0203e...e44f5', | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't mess with any of the existing styling does it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No visible style changes. Only did this for testing purposes. Adding the data-cy id on InfoCardContentWrapper did not work.