Bug 32474: Adjust tests - X-Total-Count

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@ptfs-europe.com>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Jonathan Druart 2023-10-03 09:59:24 +02:00 committed by Katrin Fischer
parent 5a46403e10
commit c5a879d5d9
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 10 additions and 0 deletions

View File

@ -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*", {