Skip to content

Commit

Permalink
fix: deisgn for SuccessStep when notification failed
Browse files Browse the repository at this point in the history
  • Loading branch information
dianasavvatina committed Feb 13, 2025
1 parent d428a8e commit 16f31e5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
9 changes: 2 additions & 7 deletions apps/web/src/components/SendFlow/SuccessStep.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,10 @@ describe("<SuccessStep />", () => {
it("renders warning message when dAppNotificationError is present", async () => {
await renderInModal(<SuccessStep dAppNotificationError="testError" hash="testHash" />);

expect(screen.getByTestId("success-no-notify-text")).toHaveTextContent(
"Transaction was performed successfully and stored on the blockchain. However, the dApp was not notified."
);
expect(screen.getByTestId("do-not-retry-text")).toHaveTextContent(
"Do not retry this operation — it has already been completed. You may need to reload the dApp page to see the updated status."
);
expect(screen.getByTestId("dapp-noticaition-error")).toHaveTextContent(
"Error on dApp notification: testError"
"Do not retry this operation; it has already been processed. You may need to reload the dApp to see the updated status."
);
expect(screen.getByTestId("dapp-noticaition-error")).toHaveTextContent("testError");
expect(screen.getByTestId("success-text")).toHaveTextContent(
"You can follow this operation's progress in the Operations section. It may take up to 30 seconds to appear."
);
Expand Down
12 changes: 4 additions & 8 deletions apps/web/src/components/SendFlow/SuccessStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export const SuccessStep = ({

const getIconAndHeader = (): StepData => {
if (dAppNotificationError) {
return [AlertTriangleIcon, color("orange"), "Operation Submitted but dApp Not Notified"];
return [AlertTriangleIcon, color("red"), "Operation submitted but dApp not notified"];
}

return [CheckCircleIcon, color("green"), "Operation Submitted"];
Expand All @@ -48,16 +48,12 @@ export const SuccessStep = ({
if (dAppNotificationError) {
return (
<>
<Text data-testid="success-no-notify-text" size="md">
Transaction was performed successfully and stored on the blockchain. However, the dApp
was not notified.
</Text>
<Text marginTop="12px" data-testid="do-not-retry-text" size="md">
<strong>Do not retry this operation</strong>it has already been completed. You may
need to reload the dApp page to see the updated status.
Do <strong>not</strong> retry this operation; it has already been processed. You may
need to reload the dApp to see the updated status.
</Text>
<Text marginTop="12px" data-testid="dapp-noticaition-error" size="md">
<strong>Error on dApp notification:</strong> {dAppNotificationError}
{dAppNotificationError}
</Text>
<Text marginTop="12px" data-testid="success-text" size="md">
{successText}
Expand Down

0 comments on commit 16f31e5

Please sign in to comment.