Bugzilla – Attachment 183167 Details for
Bug 40121
library and category not selected on the patron search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40121: Add Cypress tests
Bug-40121-Add-Cypress-tests.patch (text/plain), 3.27 KB, created by
Jonathan Druart
on 2025-06-11 14:42:58 UTC
(
hide
)
Description:
Bug 40121: Add Cypress tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-06-11 14:42:58 UTC
Size:
3.27 KB
patch
obsolete
>From 3b77c104c64c852cf20565e8adbee51c3c69dedf Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 11 Jun 2025 16:41:27 +0200 >Subject: [PATCH] Bug 40121: Add Cypress tests > >--- > .../KohaTable/PatronSearch_spec.ts | 69 +++++++++++++++++++ > 1 file changed, 69 insertions(+) > >diff --git a/t/cypress/integration/KohaTable/PatronSearch_spec.ts b/t/cypress/integration/KohaTable/PatronSearch_spec.ts >index b706f1eb800..96ff6d47ac9 100644 >--- a/t/cypress/integration/KohaTable/PatronSearch_spec.ts >+++ b/t/cypress/integration/KohaTable/PatronSearch_spec.ts >@@ -114,3 +114,72 @@ describe("ExtendedPatronAttributes", () => { > }); > }); > }); >+ >+describe("Filters", () => { >+ const table_id = "memberresultst"; >+ >+ beforeEach(() => { >+ cleanup(); >+ cy.login(); >+ cy.title().should("eq", "Koha staff interface"); >+ cy.window().then(win => { >+ win.localStorage.clear(); >+ }); >+ }); >+ >+ it.only("Keep filters in the column filters", () => { >+ cy.task("buildSampleObjects", { >+ object: "patron", >+ count: RESTdefaultPageSize, >+ values: {}, >+ }).then(patrons => { >+ // Needs more properties to not explode >+ // account_balace: balance_str.escapeHtml(...).format_price is not a function >+ patrons = patrons.map(p => ({ ...p, account_balance: 0 })); >+ >+ cy.intercept("GET", "/api/v1/patrons*", { >+ statusCode: 200, >+ body: patrons, >+ headers: { >+ "X-Base-Total-Count": baseTotalCount, >+ "X-Total-Count": baseTotalCount, >+ }, >+ }); >+ >+ cy.visit("/cgi-bin/koha/members/members-home.pl"); >+ >+ cy.window().then(win => { >+ win.categories_map = patrons.reduce((map, p) => { >+ map[p.category_id] = p.category_id; >+ return map; >+ }, {}); >+ }); >+ cy.get("form.patron_search_form .branchcode_filter").select("CPL"); >+ cy.get("form.patron_search_form .categorycode_filter").select("S"); >+ cy.get("form.patron_search_form input[type='submit']").click(); >+ >+ cy.get(`#${table_id}_wrapper .dt-info`).contains( >+ `Showing 1 to ${RESTdefaultPageSize} of ${baseTotalCount} entries` >+ ); >+ >+ cy.get(`#${table_id} thead tr`).should("have.length", 2); >+ >+ cy.get( >+ `#${table_id} thead tr th[data-filter='libraries'] select` >+ ).should("have.value", "^CPL$"); >+ // Lowercase see bug 32517 and related code in datatables.js >+ cy.get( >+ `#${table_id} thead tr th[data-filter='categories'] select` >+ ).should("have.value", "^s$"); >+ >+ cy.get(`#${table_id}_wrapper .dt_button_clear_filter`).click(); >+ cy.get( >+ `#${table_id} thead tr th[data-filter='libraries'] select` >+ ).should("have.value", ""); >+ // Lowercase see bug 32517 and related code in datatables.js >+ cy.get( >+ `#${table_id} thead tr th[data-filter='categories'] select` >+ ).should("have.value", ""); >+ }); >+ }); >+}); >-- >2.34.1
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 40121
:
183167
|
183168
|
183217
|
183224
|
183225