Skip to content
Snippets Groups Projects
Commit 76510227 authored by Max Frederiksen's avatar Max Frederiksen
Browse files

Remove test cases + pass onCancel prop to fix test

parent ff5ca43b
No related branches found
No related tags found
1 merge request!199CE-3150: Remove automatic onclose call
Pipeline #211054 passed
......@@ -23,7 +23,6 @@ describe("SimpleDialog", () => {
});
const cancelledText = "You cancelled the dialog!";
const confirmedText = "You confirmed the dialog!";
describe("ConfirmationDialog", () => {
it("should close on clicking close", () => {
......@@ -51,14 +50,6 @@ describe("ConfirmationDialog", () => {
cy.findByText(/some title/i).should("not.exist");
cy.findByText(cancelledText).should("exist");
});
it("should confirm and close on confirm", () => {
cy.mount(<Confirmation />);
cy.findByText(/some title/i).should("exist");
cy.findByRole("button", { name: /confirm/i }).click();
cy.findByText(/some title/i).should("not.exist");
cy.findByText(confirmedText).should("exist");
});
});
describe("DangerActionDialog", () => {
......@@ -81,12 +72,6 @@ describe("DangerActionDialog", () => {
cy.findByRole("textbox", { name: /ec234-67hdj/i }).type("ec234-67hdj");
cy.findByRole("button", { name: /delete/i }).should("be.enabled");
});
it("should close dialog on confirm button click", () => {
mountDangerActionDialog();
cy.findByRole("textbox", { name: /ec234-67hdj/i }).type("ec234-67hdj");
cy.findByRole("button", { name: /delete/i }).click();
cy.findByText(/You confirmed a danger action!/i).should("exist");
});
it("should disable confirm button clear text field on cancel", () => {
mountDangerActionDialog();
cy.findByRole("textbox", { name: /ec234-67hdj/i }).type("ec234-67hdj");
......
......@@ -227,6 +227,7 @@ export const ConfirmDangerActionDialog = ({ ...props }) => {
confirmText={confirmText}
cancelText="Cancel"
onClose={handleClose}
onCancel={handleClose}
content={
<Grid
container
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment