Bugzilla – Attachment 187843 Details for
Bug 40995
Patron search autocomplete adds extraneous spacing and punctuation when patron lacks surname
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40995: Add Cypress tests
Bug-40995-Add-Cypress-tests.patch (text/plain), 1.82 KB, created by
Jonathan Druart
on 2025-10-13 14:00:07 UTC
(
hide
)
Description:
Bug 40995: Add Cypress tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-10-13 14:00:07 UTC
Size:
1.82 KB
patch
obsolete
>From b8d395d04007d4c513dc596940bb0d6eb8f941ad Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 13 Oct 2025 15:56:59 +0200 >Subject: [PATCH] Bug 40995: Add Cypress tests > >--- > t/cypress/integration/Patron/Format.ts | 31 ++++++++++++++++++++++++++ > 1 file changed, 31 insertions(+) > >diff --git a/t/cypress/integration/Patron/Format.ts b/t/cypress/integration/Patron/Format.ts >index 52b3a896000..9b82a2869f4 100644 >--- a/t/cypress/integration/Patron/Format.ts >+++ b/t/cypress/integration/Patron/Format.ts >@@ -131,6 +131,37 @@ describe("Display patron - autocomplete", () => { > }); > }); > }); >+ >+ it("should have correct punctuation when surname is missing", function () { >+ cy.task("buildSampleObjects", { >+ object: "patron", >+ count: 1, >+ values: { surname: null }, >+ }).then(patrons => { >+ cy.intercept("GET", "/api/v1/patrons*", { >+ statusCode: 200, >+ body: patrons, >+ headers: { >+ "X-Base-Total-Count": "1", >+ "X-Total-Count": "1", >+ }, >+ }); >+ >+ cy.visit("/cgi-bin/koha/mainpage.pl"); >+ >+ const patron = patrons[0]; >+ cy.get("#findborrower").type(patron.firstname); >+ >+ // invert_name is set >+ cy.get(`ul.ui-autocomplete li a`).should($el => { >+ let re = new RegExp( >+ `^${patron.preferred_name} ${patron.middle_name} \\(${patron.other_name}\\) \\(${patron.cardnumber}\\)` >+ ); >+ const displayedText = $el.text().replace(/ /g, " ").trim(); >+ expect(displayedText).to.match(re); >+ }); >+ }); >+ }); > }); > > describe("Display patron - no search", () => { >-- >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 40995
:
187739
|
187745
|
187843
|
187850
|
188808
|
188809
|
188810