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:
parent
61f9a253e4
commit
0b9c7a09d3
|
|
@ -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();
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue