mirror of
https://seed.radicle.dev/rad:z4V1sjrXqjvFdnCUbxPFqd5p4DtH5.git
synced 2026-10-26 07:00:38 +08:00
This gets rid of the testing-library-* and cypress-vite-devserver dependencies and updates the specs according to the latest Cypress documentation. Signed-off-by: Rūdolfs Ošiņš <rudolfs@osins.org>
45 lines
1.3 KiB
TypeScript
45 lines
1.3 KiB
TypeScript
import Error from "./Error.svelte";
|
|
import { Failure } from "@app/error";
|
|
|
|
describe("Error", () => {
|
|
it("should show passed in props", () => {
|
|
cy.mount(Error, {
|
|
props: {
|
|
subtitle: "Subtitle of Modal",
|
|
error: {
|
|
type: Failure.InsufficientBalance,
|
|
txHash:
|
|
"0x8b678e51f970c5307bf45a8bcea373b597f9acbcea5c5ba784a1d383361a89d1",
|
|
message: "Not enough RAD",
|
|
},
|
|
},
|
|
});
|
|
cy.get("body").contains("Error").should("be.visible");
|
|
cy.get("body").contains("Subtitle of Modal").should("be.visible");
|
|
cy.get("body").contains("Not enough RAD").should("be.visible");
|
|
cy.get("button").contains("Back").should("be.visible");
|
|
});
|
|
|
|
it("should show custom error message", () => {
|
|
cy.mount(Error, {
|
|
props: {
|
|
subtitle: "Subtitle of Modal",
|
|
message: "Error message to check for",
|
|
},
|
|
});
|
|
cy.get("body").contains("Error message to check for").should("be.visible");
|
|
});
|
|
|
|
it("should change button label to Close when floating", () => {
|
|
cy.mount(Error, {
|
|
props: {
|
|
title: "Title of Modal",
|
|
subtitle: "Subtitle of Modal",
|
|
message: "Error message to check for",
|
|
floating: true,
|
|
},
|
|
});
|
|
cy.get("button").contains("Close").should("be.visible");
|
|
});
|
|
});
|