Bug 33422: Add cypress test
This patch adds a cypress test to check whether the "active" class is correctly updating when navigating
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
(cherry picked from commit 0b16749efb)
Signed-off-by: Jacob O'Mara <jacobomara901@gmail.com>
This commit is contained in:
parent
b58d413963
commit
cffc3331e5
|
|
@ -0,0 +1,38 @@
|
|||
describe("Searchbar header changes", () => {
|
||||
before(() => {
|
||||
cy.fetch_initial_ERM_sys_pref_value();
|
||||
cy.set_ERM_sys_pref_value(true);
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
cy.login();
|
||||
cy.title().should("eq", "Koha staff interface");
|
||||
});
|
||||
|
||||
after(() => {
|
||||
cy.reset_initial_ERM_sys_pref_value();
|
||||
});
|
||||
|
||||
it("Default option is agreements", () => {
|
||||
cy.visit("/cgi-bin/koha/erm/erm.pl");
|
||||
cy.get("#agreement_search_tab").parent().should("have.class", "active")
|
||||
|
||||
cy.visit("/cgi-bin/koha/erm/agreements");
|
||||
cy.get("#agreement_search_tab").parent().should("have.class", "active")
|
||||
})
|
||||
|
||||
it("Default option also applies to licenses", () => {
|
||||
cy.visit("/cgi-bin/koha/erm/license");
|
||||
cy.get("#agreement_search_tab").parent().should("have.class", "active")
|
||||
})
|
||||
|
||||
it("Should change to packages when in local packages", () => {
|
||||
cy.visit("/cgi-bin/koha/erm/eholdings/local/packages");
|
||||
cy.get("#package_search_tab").parent().should("have.class", "active")
|
||||
})
|
||||
|
||||
it("Should change to titles when in local titles", () => {
|
||||
cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
|
||||
cy.get("#title_search_tab").parent().should("have.class", "active")
|
||||
})
|
||||
})
|
||||
Loading…
Reference in New Issue