From 8aa9805a497d9603a027747345fd79206df426ae Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Wed, 26 Oct 2022 08:39:48 +0200 Subject: [PATCH] Bug 32030: Fix Cypress tests - Mock GET agreements route Or the test will fail if agreements exist Signed-off-by: Jonathan Field Signed-off-by: Martin Renvoize Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- cypress/integration/Packages_spec.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/cypress/integration/Packages_spec.ts b/cypress/integration/Packages_spec.ts index 71962e9e6e..dd517a4dc1 100644 --- a/cypress/integration/Packages_spec.ts +++ b/cypress/integration/Packages_spec.ts @@ -58,6 +58,9 @@ describe("Package CRUD operations", () => { }); it("Add package", () => { + + cy.intercept("GET", "/api/v1/erm/agreements", []); + // Click the button in the toolbar cy.visit("/cgi-bin/koha/erm/eholdings/local/packages"); cy.contains("New package").click(); @@ -84,6 +87,7 @@ describe("Package CRUD operations", () => { cy.get("#package_agreements").contains( "There are no agreements created yet" ); + // FIXME Test with agreements // Submit the form, get 500 cy.intercept("POST", "/api/v1/erm/eholdings/local/packages", { -- 2.39.2