View | Details | Raw Unified | Return to bug 40345
Collapse All | Expand All

(-)a/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts (-22 / +29 lines)
Lines 1-35 Link Here
1
describe("opac-readingrecord", () => {
1
describe("opac-readingrecord", () => {
2
    beforeEach(() => {
2
    beforeEach(() => {
3
        cy.loginOpac();
3
        let objects_to_cleanup = [];
4
        let objects_to_cleanup = [];
4
        cy.task("apiGet", {
5
        cy.task("apiGet", {
5
            endpoint: "/api/v1/patrons/51",
6
            endpoint: "/api/v1/patrons/51",
6
        }).then(patron => {
7
        })
7
            [...Array(51)].forEach(() => {
8
            .then(patron => {
8
                cy.task("insertSampleCheckout", {
9
                [...Array(51)].forEach(() => {
9
                    patron: patron,
10
                    cy.task("insertSampleCheckout", {
10
                }).then(objects_checkout => {
11
                        patron: patron,
11
                    cy.task("query", {
12
                    }).then(objects_checkout => {
12
                        sql: "INSERT INTO old_issues SELECT * FROM issues WHERE issue_id=?",
13
                        cy.task("query", {
13
                        values: [objects_checkout.checkout.checkout_id],
14
                            sql: "INSERT INTO old_issues SELECT * FROM issues WHERE issue_id=?",
14
                    });
15
                            values: [objects_checkout.checkout.checkout_id],
15
                    cy.task("query", {
16
                        })
16
                        sql: "DELETE FROM issues WHERE issue_id=?",
17
                            .then(() => {
17
                        values: [objects_checkout.checkout.checkout_id],
18
                                cy.task("query", {
19
                                    sql: "DELETE FROM issues WHERE issue_id=?",
20
                                    values: [
21
                                        objects_checkout.checkout.checkout_id,
22
                                    ],
23
                                });
24
                            })
25
                            .then(() => {
26
                                objects_checkout.old_checkout =
27
                                    objects_checkout.checkout;
28
                                delete objects_checkout.checkout;
29
                                objects_to_cleanup.push(objects_checkout);
30
                            });
18
                    });
31
                    });
19
                    objects_checkout.old_checkout = objects_checkout.checkout;
20
                    delete objects_checkout.checkout;
21
                    objects_to_cleanup.push(objects_checkout);
22
                });
32
                });
33
            })
34
            .then(() => {
35
                cy.wrap(objects_to_cleanup).as("objects_to_cleanup");
23
            });
36
            });
24
25
            cy.wrap(objects_to_cleanup).as("objects_to_cleanup");
26
        });
27
28
        cy.loginOpac();
29
    });
37
    });
30
38
31
    afterEach(function () {
39
    afterEach(function () {
32
        cy.task("deleteSampleObjects", [this.objects_to_cleanup]);
40
        cy.task("deleteSampleObjects", this.objects_to_cleanup);
33
    });
41
    });
34
42
35
    it("50 items should be displayed by default", function () {
43
    it("50 items should be displayed by default", function () {
36
- 

Return to bug 40345