Bug 33416: Fix Searchbar_spec.ts
[koha.git] / t / cypress / integration / ERM / Searchbar_spec.ts
1 describe("Searchbar header changes", () => {
2
3     beforeEach(() => {
4         cy.login();
5         cy.title().should("eq", "Koha staff interface");
6         cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}');
7         cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}');
8     });
9
10     it("Default option is agreements", () => {
11         cy.visit("/cgi-bin/koha/erm/erm.pl");
12         cy.get("#agreement_search_tab").parent().should("have.class", "active")
13
14         cy.visit("/cgi-bin/koha/erm/agreements");
15         cy.get("#agreement_search_tab").parent().should("have.class", "active")
16     })
17
18     it("Default option also applies to licenses", () => {
19         cy.visit("/cgi-bin/koha/erm/license");
20         cy.get("#agreement_search_tab").parent().should("have.class", "active")
21     })
22
23     it("Should change to packages when in local packages", () => {
24         cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
25         cy.get("#package_search_tab").parent().should("have.class", "active")
26     })
27
28     it("Should change to titles when in local titles", () => {
29         cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
30         cy.get("#title_search_tab").parent().should("have.class", "active")
31     })
32 })