From 51d3c80a485500e0908c0c87887ed0377060d9de Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Tue, 3 Oct 2023 09:59:24 +0200 Subject: [PATCH] Bug 32474: Adjust tests - X-Total-Count Signed-off-by: Matt Blenkinsop --- t/cypress/integration/ERM/Agreements_spec.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts index 7b6f3742fd..045d549af1 100644 --- a/t/cypress/integration/ERM/Agreements_spec.ts +++ b/t/cypress/integration/ERM/Agreements_spec.ts @@ -409,9 +409,14 @@ describe("Agreement CRUD operations", () => { // Add new license let licenses_to_relate = get_licenses_to_relate(); let related_license = agreement.agreement_licenses[0]; + let licenses_count = licenses_to_relate.length.toString(); cy.intercept("GET", "/api/v1/erm/licenses*", { statusCode: 200, body: licenses_to_relate, + headers: { + "X-Base-Total-Count": licenses_count, + "X-Total-Count": licenses_count, + }, }); cy.visit("/cgi-bin/koha/erm/agreements/add"); cy.get("#agreement_licenses").contains("Add new license").click(); @@ -503,9 +508,14 @@ describe("Agreement CRUD operations", () => { "get-agreement" ); // Intercept related licenses request after entering agreement edit + let licenses_count = licenses_to_relate.length.toString(); cy.intercept("GET", "/api/v1/erm/licenses*", { statusCode: 200, body: licenses_to_relate, + headers: { + "X-Base-Total-Count": licenses_count, + "X-Total-Count": licenses_count, + }, }).as("get-related-licenses"); // Intercept related agreements request after entering agreement edit cy.intercept("GET", "/api/v1/erm/agreements*", { -- 2.37.1 (Apple Git-137.1)