Bugzilla – Attachment 155020 Details for
Bug 34466
"Clear filter" always disabled
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 34466: Cypress tests
Bug-34466-Cypress-tests.patch (text/plain), 2.47 KB, created by
Pedro Amorim
on 2023-08-31 16:19:29 UTC
(
hide
)
Description:
Bug 34466: Cypress tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-08-31 16:19:29 UTC
Size:
2.47 KB
patch
obsolete
>From c60f153a914fbe3735a863020a57b8602c2bf0d7 Mon Sep 17 00:00:00 2001 >From: Pedro Amorim <pedro.amorim@ptfs-europe.com> >Date: Thu, 31 Aug 2023 16:14:45 +0000 >Subject: [PATCH] Bug 34466: Cypress tests > >--- > t/cypress/integration/KohaTable_spec.ts | 58 +++++++++++++++++++++++++ > 1 file changed, 58 insertions(+) > create mode 100644 t/cypress/integration/KohaTable_spec.ts > >diff --git a/t/cypress/integration/KohaTable_spec.ts b/t/cypress/integration/KohaTable_spec.ts >new file mode 100644 >index 0000000000..c24dae0985 >--- /dev/null >+++ b/t/cypress/integration/KohaTable_spec.ts >@@ -0,0 +1,58 @@ >+import { mount } from "@cypress/vue"; >+ >+describe("Table search", () => { >+ beforeEach(() => { >+ cy.login(); >+ cy.title().should("eq", "Koha staff interface"); >+ cy.intercept( >+ "GET", >+ "/api/v1/erm/config", >+ '{"settings":{"ERMModule":"1","ERMProviders":["local"]}}' >+ ); >+ }); >+ >+ it("Input search bar and clear filter ", () => { >+ let erm_title = cy.get_title(); >+ let titles = [erm_title]; >+ >+ cy.intercept("GET", "/api/v1/erm/eholdings/local/titles*", { >+ statusCode: 200, >+ body: titles, >+ headers: { >+ "X-Base-Total-Count": "1", >+ "X-Total-Count": "1", >+ }, >+ }).as("get_titles"); >+ >+ cy.visit("/cgi-bin/koha/erm/eholdings/local/titles"); >+ cy.get("#titles_list").contains("Showing 1 to 1 of 1 entries"); >+ >+ // Should be disabled by default - empty search bar >+ cy.get(".datatable button.dt_button_clear_filter").should( >+ "have.class", >+ "disabled" >+ ); >+ >+ // Type something in the input search bar >+ cy.get(".datatable input[type='search']").type( >+ erm_title.publication_title >+ ); >+ cy.get(".datatable input[type='search']").should( >+ "have.value", >+ erm_title.publication_title >+ ); >+ >+ // Should no longer be disabled >+ cy.get(".datatable button.dt_button_clear_filter").should( >+ "not.have.class", >+ "disabled" >+ ); >+ >+ // Click the clear_filter button >+ cy.get(".datatable button.dt_button_clear_filter").click(); >+ cy.get(".datatable input[type='search']").should("have.value", ""); >+ >+ // TODO: Some actual live API with data requests to test the search actually works >+ // and returns results accordingly (or not) >+ }); >+}); >-- >2.30.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 34466
:
154799
|
155020
|
155021
|
155064
|
155065