From 64a271992a7022be061a9e65a056c96c990b1a92 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 26 Sep 2025 10:11:12 +0200 Subject: [PATCH] Bug 38201: Improve Agreements/Edit tests It removes the following DT warning in the console DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'status' for row 0, column 4. For more information about this error, please see https://datatables.net/tn/4 related to bug 40809 (cherry picked from commit bc0ad04dddbe8e3462238a14b0e9e5caaa3cdfd7) Signed-off-by: Jonathan Druart Signed-off-by: Lucas Gass --- t/cypress/integration/ERM/Agreements_spec.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts index 7395f9751d9..6416c7f8ae9 100644 --- a/t/cypress/integration/ERM/Agreements_spec.ts +++ b/t/cypress/integration/ERM/Agreements_spec.ts @@ -393,28 +393,19 @@ describe("Agreement CRUD operations", () => { }).as("get-vendor-options"); // Intercept initial /agreements request once - cy.intercept( - { - method: "GET", - url: "/api/v1/erm/agreements*", - times: 1, - }, - { - body: agreements, - } - ); - + // and // Intercept follow-up 'search' request after entering /agreements - cy.intercept("GET", "/api/v1/erm/agreements?_page*", { + cy.intercept("GET", "/api/v1/erm/agreements*", { statusCode: 200, body: agreements, headers: { "X-Base-Total-Count": "1", "X-Total-Count": "1", }, - }).as("get-single-agreement-search-result"); + }).as("get-agreements"); cy.visit("/cgi-bin/koha/erm/agreements"); - cy.wait("@get-single-agreement-search-result"); + cy.wait("@get-agreements"); + cy.wait("@get-agreements"); // Intercept request after edit click cy.intercept("GET", "/api/v1/erm/agreements/*", agreement).as( -- 2.51.0