Bug 40002: Add a cypress test

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
(cherry picked from commit da75bdc692)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
Jonathan Druart 2025-05-27 10:16:15 +02:00 committed by Paul Derscheid
parent 61f9a253e4
commit 0b9c7a09d3
No known key found for this signature in database
GPG Key ID: C25F9FD44CED595B
1 changed files with 32 additions and 0 deletions

View File

@ -375,6 +375,38 @@ describe("kohaTable (using REST API)", () => {
);
});
});
it("Browse by last name", () => {
cy.task("buildSampleObjects", {
object: "patron",
count: RESTdefaultPageSize,
values: {},
}).then(patrons => {
// Needs more properties to not explode
// account_balace: balance_str.escapeHtml(...).format_price is not a function
patrons = patrons.map(p => ({ ...p, account_balance: 0 }));
cy.intercept("GET", "/api/v1/patrons*", {
statusCode: 200,
body: patrons,
headers: {
"X-Base-Total-Count": baseTotalCount,
"X-Total-Count": baseTotalCount,
},
});
cy.visit("/cgi-bin/koha/members/members-home.pl");
cy.window().then(win => {
win.categories_map = patrons.reduce((map, p) => {
map[p.category_id] = p.category_id;
return map;
}, {});
});
cy.get("#searchresults .browse .filterByLetter:first").click();
});
});
});
});