From 183e3ea1d22739ed7183e9ac0e381563260e5179 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Oct 2022 08:17:48 +0200 Subject: [PATCH] Bug 32030: Fix Cypress tests - flatpickr date format ...but then we don't have access to the formatted date values, and need to compare the ISO dates. FIXME - Find a way to compare the displayed/formatted dates Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- cypress/integration/Agreements_spec.ts | 8 ++++---- cypress/integration/Licenses_spec.ts | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cypress/integration/Agreements_spec.ts b/cypress/integration/Agreements_spec.ts index ea287ab125..f969a95246 100644 --- a/cypress/integration/Agreements_spec.ts +++ b/cypress/integration/Agreements_spec.ts @@ -257,15 +257,15 @@ describe("Agreement CRUD operations", () => { ); cy.get("#agreement_status .vs__selected").contains("Active"); cy.get("#agreement_is_perpetual_no").should("be.checked"); - cy.get("#started_on_0").invoke("val").should("eq", dates["today_us"]); - cy.get("#ended_on_0").invoke("val").should("eq", dates["tomorrow_us"]); + cy.get("#started_on_0").invoke("val").should("eq", dates["today_iso"]); + cy.get("#ended_on_0").invoke("val").should("eq", dates["tomorrow_iso"]); cy.get("#cancellation_deadline_0").invoke("val").should("eq", ""); cy.get("#notes_0").should("have.value", ""); - cy.get("#started_on_1").invoke("val").should("eq", dates["today_us"]); + cy.get("#started_on_1").invoke("val").should("eq", dates["today_iso"]); cy.get("#ended_on_1").invoke("val").should("eq", ""); cy.get("#cancellation_deadline_1") .invoke("val") - .should("eq", dates["tomorrow_us"]); + .should("eq", dates["tomorrow_iso"]); cy.get("#notes_1").should("have.value", "this is a note"); // Submit the form, get 500 diff --git a/cypress/integration/Licenses_spec.ts b/cypress/integration/Licenses_spec.ts index 6a8b32dc55..8abdf5eed0 100644 --- a/cypress/integration/Licenses_spec.ts +++ b/cypress/integration/Licenses_spec.ts @@ -145,8 +145,8 @@ describe("License CRUD operations", () => { ); cy.get("#license_type .vs__selected").contains("Local"); cy.get("#license_status .vs__selected").contains("Active"); - cy.get("#started_on").invoke("val").should("eq", dates["today_us"]); - cy.get("#ended_on").invoke("val").should("eq", dates["tomorrow_us"]); + cy.get("#started_on").invoke("val").should("eq", dates["today_iso"]); + cy.get("#ended_on").invoke("val").should("eq", dates["tomorrow_iso"]); // Submit the form, get 500 cy.intercept("PUT", "/api/v1/erm/licenses/*", { -- 2.39.5