-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7096b2f
commit 300957f
Showing
2 changed files
with
51 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { SuccessStep } from "./SuccessStep"; // Adjust path if needed | ||
import { renderInModal, screen } from "../../testUtils"; | ||
|
||
describe("<SuccessStep />", () => { | ||
it("renders success message when there is no dAppNotificationError", async () => { | ||
await renderInModal(<SuccessStep hash="testHash" />); | ||
|
||
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." | ||
); | ||
expect(screen.queryByTestId("success-no-notify-text")).not.toBeInTheDocument(); | ||
expect(screen.queryByTestId("do-not-retry-text")).not.toBeInTheDocument(); | ||
expect(screen.queryByTestId("dapp-noticaition-error")).not.toBeInTheDocument(); | ||
expect(screen.getByRole("button", { name: "See all Operations" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "View in TzKT" })).toHaveAttribute( | ||
"href", | ||
"https://tzkt.io/testHash" | ||
); | ||
}); | ||
|
||
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" | ||
); | ||
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." | ||
); | ||
expect(screen.getByRole("button", { name: "See all Operations" })).toBeInTheDocument(); | ||
expect(screen.getByRole("link", { name: "View in TzKT" })).toHaveAttribute( | ||
"href", | ||
"https://tzkt.io/testHash" | ||
); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
300957f
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.