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

(-)a/t/cypress/integration/Islands/AcquisitionsMenu_spec.ts (-1 / +49 lines)
Line 0 Link Here
0
- 
1
describe("Acquisitions menu", () => {
2
    beforeEach(() => {
3
        cy.login();
4
        cy.title().should("eq", "Koha staff interface");
5
6
        cy.query(
7
            "UPDATE systempreferences SET value=0 WHERE variable='EDIFACT'"
8
        );
9
        cy.query(
10
            "UPDATE systempreferences SET value=0 WHERE variable='MarcOrderingAutomation'"
11
        );
12
    });
13
14
    it("Should render a left menu", () => {
15
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
16
        cy.get("#navmenulist").should("be.visible");
17
        cy.get("#navmenulist a").should("have.length", 14);
18
    });
19
20
    it("Should show/hide links based on sysprefs", () => {
21
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
22
        cy.get("#navmenulist").should("be.visible");
23
24
        cy.query(
25
            "UPDATE systempreferences SET value=1 WHERE variable='EDIFACT'"
26
        );
27
        cy.get("#navmenulist a").should("have.length", 17);
28
    });
29
30
    it("Should show/hide links based on permissions", () => {
31
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
32
        cy.get("#navmenulist").should("be.visible");
33
34
        cy.query("UPDATE borrowers SET flags=2052 WHERE borrowernumber=51");
35
        cy.get("#navmenulist a").should("have.length", 8);
36
    });
37
    it("Should correctly apply the 'current' class", () => {
38
        cy.visit("/cgi-bin/koha/acqui/acqui-home.pl");
39
        cy.get("#navmenulist").should("be.visible");
40
41
        cy.get("#navmenulist a")
42
            .contains("Acquisitions home")
43
            .should("have.class", "current");
44
        cy.get("#navmenulist a").contains("Budgets").click();
45
        cy.get("#navmenulist a")
46
            .contains("Budgets")
47
            .should("have.class", "current");
48
    });
49
});

Return to bug 38941