1 import { mount } from "@cypress/vue";
3 describe("Table search", () => {
6 cy.title().should("eq", "Koha staff interface");
10 '{"settings":{"ERMModule":"1","ERMProviders":["local"]}}'
14 it("Input search bar and clear filter ", () => {
15 let erm_title = cy.get_title();
16 let titles = [erm_title];
18 cy.intercept("GET", "/api/v1/erm/eholdings/local/titles*", {
22 "X-Base-Total-Count": "1",
27 cy.visit("/cgi-bin/koha/erm/eholdings/local/titles");
28 cy.get("#titles_list").contains("Showing 1 to 1 of 1 entries");
30 // Should be disabled by default - empty search bar
31 cy.get(".datatable button.dt_button_clear_filter").should(
36 // Type something in the input search bar
37 cy.get(".datatable input[type='search']").type(
38 erm_title.publication_title
40 cy.get(".datatable input[type='search']").should(
42 erm_title.publication_title
45 // Should no longer be disabled
46 cy.get(".datatable button.dt_button_clear_filter").should(
51 // Click the clear_filter button
52 cy.get(".datatable button.dt_button_clear_filter").click();
53 cy.get(".datatable input[type='search']").should("have.value", "");
55 // TODO: Some actual live API with data requests to test the search actually works
56 // and returns results accordingly (or not)