Bug 40345: Add tests for bug 38102
Test plan:
yarn cypress run --spec t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts
must return green
Revert commits from bug 38102
Run again the Cypress tests
=> They fail
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
(cherry picked from commit 6a913fcc8a)
Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de>
This commit is contained in:
parent
d942d12dba
commit
9880d01b29
|
|
@ -0,0 +1,43 @@
|
|||
describe("opac-readingrecord", () => {
|
||||
beforeEach(() => {
|
||||
let objects_to_cleanup = [];
|
||||
cy.task("apiGet", {
|
||||
endpoint: "/api/v1/patrons/51",
|
||||
}).then(patron => {
|
||||
[...Array(51)].forEach(() => {
|
||||
cy.task("insertSampleCheckout", {
|
||||
patron: patron,
|
||||
}).then(objects_checkout => {
|
||||
objects_to_cleanup.push(objects_checkout);
|
||||
cy.task("query", {
|
||||
sql: "INSERT INTO old_issues SELECT * FROM issues WHERE issue_id=?",
|
||||
values: [objects_checkout.checkout.checkout_id],
|
||||
});
|
||||
cy.task("query", {
|
||||
sql: "DELETE FROM issues WHERE issue_id=?",
|
||||
values: [objects_checkout.checkout.checkout_id],
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
cy.wrap(objects_to_cleanup).as("objects_to_cleanup");
|
||||
});
|
||||
|
||||
cy.loginOpac();
|
||||
});
|
||||
|
||||
afterEach(function () {
|
||||
cy.task("deleteSampleObjects", [this.objects_to_cleanup]);
|
||||
});
|
||||
|
||||
it("50 items should be displayed by default", function () {
|
||||
cy.visitOpac("/cgi-bin/koha/opac-readingrecord.pl");
|
||||
|
||||
cy.contains("Showing 1 to 50 of 50 entries");
|
||||
cy.get("table#readingrec tbody tr").should("have.length", 50);
|
||||
|
||||
cy.contains("Show all items").click();
|
||||
cy.contains("Showing 1 to 51 of 51 entries");
|
||||
cy.get("table#readingrec tbody tr").should("have.length", 51);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue