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

(-)a/t/cypress/integration/KohaTable_spec.ts (-1 / +62 lines)
Lines 468-470 describe("ERM ", () => { Link Here
468
        });
468
        });
469
    });
469
    });
470
});
470
});
471
- 
471
472
describe("Hit all tables", () => {
473
    beforeEach(() => {
474
        cy.login();
475
        cy.title().should("eq", "Koha staff interface");
476
        cy.window().then(win => {
477
            win.localStorage.clear();
478
        });
479
    });
480
481
    describe("catalogue/detail/holdings_table", () => {
482
        const table_id = "holdings_table";
483
        it("correctly init", () => {
484
            const biblio_id = 1;
485
            cy.task("buildsampleobjects", {
486
                object: "item",
487
                count: restdefaultpagesize,
488
                values: {
489
                    biblio_id,
490
                    checkout: null,
491
                    transfer: null,
492
                    lost_status: 0,
493
                    withdrawn: 0,
494
                    damaged_status: 0,
495
                    not_for_loan_status: 0,
496
                    course_item: null,
497
                },
498
            }).then(items => {
499
                cy.intercept("get", `/api/v1/biblios/${biblio_id}/items*`, {
500
                    statuscode: 200,
501
                    body: items,
502
                    headers: {
503
                        "x-base-total-count": basetotalcount,
504
                        "x-total-count": basetotalcount,
505
                    },
506
                });
507
508
                cy.visit(
509
                    "/cgi-bin/koha/catalogue/detail.pl?biblionumber=" +
510
                        biblio_id
511
                );
512
513
                cy.window().then(win => {
514
                    win.libraries_map = items.reduce((map, i) => {
515
                        map[i.library_id] = i.library_id;
516
                        return map;
517
                    }, {});
518
                });
519
520
                cy.get(`#${table_id}_wrapper tbody tr`).should(
521
                    "have.length",
522
                    restdefaultpagesize
523
                );
524
525
                cy.get(".show_filters").click();
526
                cy.get(`#${table_id}_wrapper .dt-info`).contains(
527
                    `showing 1 to ${restdefaultpagesize} of ${basetotalcount} entries`
528
                );
529
            });
530
        });
531
    });
532
});

Return to bug 38461