Bugzilla – Attachment 182110 Details for
Bug 39473
Drop-down filters on item holdings table should match codes exactly
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 39473: Add Cypress tests
Bug-39473-Add-Cypress-tests.patch (text/plain), 3.72 KB, created by
Lucas Gass (lukeg)
on 2025-05-08 19:28:41 UTC
(
hide
)
Description:
Bug 39473: Add Cypress tests
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-05-08 19:28:41 UTC
Size:
3.72 KB
patch
obsolete
>From 8fa591e148a4bf28b111e8c0424c8537f1eba620 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 22 Apr 2025 14:40:42 +0200 >Subject: [PATCH] Bug 39473: Add Cypress tests > >Signed-off-by: David Nind <david@davidnind.com> >Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> >--- > .../integration/KohaTable/Holdings_spec.ts | 41 +++++++++++++++++++ > 1 file changed, 41 insertions(+) > >diff --git a/t/cypress/integration/KohaTable/Holdings_spec.ts b/t/cypress/integration/KohaTable/Holdings_spec.ts >index 869d01e136d..fa7756212c6 100644 >--- a/t/cypress/integration/KohaTable/Holdings_spec.ts >+++ b/t/cypress/integration/KohaTable/Holdings_spec.ts >@@ -330,6 +330,7 @@ describe("catalogue/detail/holdings_table", () => { > }); > > cy.get(`#${table_id}_wrapper input.dt-input`).clear(); >+ cy.wait("@searchItems"); > cy.get(`#${table_id}_wrapper input.dt-input`).type(library_name); > > cy.wait("@searchItems").then(interception => { >@@ -342,6 +343,7 @@ describe("catalogue/detail/holdings_table", () => { > let item_type_id = items[0].item_type.item_type_id; > let item_type_description = items[0].item_type.description; > cy.get(`#${table_id}_wrapper input.dt-input`).clear(); >+ cy.wait("@searchItems"); > cy.get(`#${table_id}_wrapper input.dt-input`).type(item_type_id); > > cy.wait("@searchItems").then(interception => { >@@ -352,6 +354,7 @@ describe("catalogue/detail/holdings_table", () => { > }); > > cy.get(`#${table_id}_wrapper input.dt-input`).clear(); >+ cy.wait("@searchItems"); > cy.get(`#${table_id}_wrapper input.dt-input`).type( > item_type_description > ); >@@ -362,6 +365,44 @@ describe("catalogue/detail/holdings_table", () => { > new RegExp(`"me.item_type_id":\\["${item_type_id}"\\]`) > ); > }); >+ >+ cy.viewport(2999, 2999); >+ cy.get(`#${table_id}_wrapper input.dt-input`).clear(); >+ cy.wait("@searchItems"); >+ // Show filters if not there already >+ cy.get(`.${table_id}_table_controls .show_filters`) >+ .then(link => { >+ if (link.is(":visible")) { >+ cy.wrap(link).click(); >+ cy.wait("@searchItems"); >+ } >+ }) >+ .then(() => { >+ // Select first (non-empty) option >+ cy.get( >+ `#${table_id}_wrapper th#holdings_itype select` >+ ).then(select => { >+ const raw_value = select.find("option").eq(1).val(); >+ expect(raw_value).to.match(/^\^/); >+ expect(raw_value).to.match(/\$$/); >+ item_type_id = raw_value.replace(/^\^|\$$/g, ""); // Remove ^ and $ >+ }); >+ cy.get( >+ `#${table_id}_wrapper th#holdings_itype select option` >+ ) >+ .eq(1) >+ .then(o => { >+ cy.get( >+ `#${table_id}_wrapper th#holdings_itype select` >+ ).select(o.val(), { force: true }); >+ }); >+ cy.wait("@searchItems").then(interception => { >+ const q = interception.request.query.q; >+ expect(q).to.match( >+ new RegExp(`{"me.item_type_id":"${item_type_id}"}`) >+ ); >+ }); >+ }); > }); > }); > }); >-- >2.39.5
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 39473
:
181258
|
181259
|
181268
|
181570
|
181571
|
182109
| 182110