Koha/t/cypress/integration/ERM/Searchbar_spec.ts
Jonathan Druart 5078f9f4df Bug 33606: Add a erm/config route to retrieve the ERM config needed for the Vue app
This could be extended later in bug 32968 to pass the permission of the
logged in user.

Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
(cherry picked from commit cda3c377a20c401ef9a755f24eb839d515a8af72)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
2023-11-02 11:17:31 -10:00

36 lines
1.3 KiB
TypeScript

import { mount } from "@cypress/vue";
describe("Searchbar header changes", () => {
beforeEach(() => {
cy.login();
cy.title().should("eq", "Koha staff interface");
cy.intercept(
"GET",
"/api/v1/erm/config",
'{"settings":{"ERMModule":"1","ERMProviders":["local"]}}'
);
});
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("Should change to licenses when in licenses", () => {
cy.visit("/cgi-bin/koha/erm/licenses");
cy.get("#license_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");
});
});