Bugzilla – Attachment 183940 Details for
Bug 40320
Missing Cypress tests for patron address display
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40320: (bug 40319 follow-up) Add Cypress tests
Bug-40320-bug-40319-follow-up-Add-Cypress-tests.patch (text/plain), 3.27 KB, created by
Jonathan Druart
on 2025-07-10 12:54:20 UTC
(
hide
)
Description:
Bug 40320: (bug 40319 follow-up) Add Cypress tests
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-10 12:54:20 UTC
Size:
3.27 KB
patch
obsolete
>From 442075e216441cf7ce2cd1922758ca33adcd7530 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 18 Jun 2025 14:20:29 +0200 >Subject: [PATCH] Bug 40320: (bug 40319 follow-up) Add Cypress tests > >Test plan: >Make sure the display of city, state and zipcode is the same as before >the patch >Confirm that the new Cypress tests pass >--- > .../includes/member-display-address-style.inc | 4 +- > t/cypress/integration/Patron/Address.ts | 44 +++++++++++++++++++ > 2 files changed, 45 insertions(+), 3 deletions(-) > create mode 100644 t/cypress/integration/Patron/Address.ts > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc >index 3e0bb172e01..31e5c557e6e 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-display-address-style.inc >@@ -31,9 +31,7 @@ > <li class="patroncity"> > <span class="city">[%~ patron.city |html ~%]</span> > [%~ IF ( patron.state ) %] >- [%~ IF ( patron.city ) ~%] >- , >- [% END ~%] >+ [%~ IF ( patron.city ) ~%][% ", " %][% END ~%] > <span class="state">[% patron.state |html ~%]</span> > [%~ END ~%] > [%~ IF ( patron.zipcode ) %]<span class="zipcode">[%~ " " _ patron.zipcode |html ~%]</span>[% END %] >diff --git a/t/cypress/integration/Patron/Address.ts b/t/cypress/integration/Patron/Address.ts >new file mode 100644 >index 00000000000..1d09a43690c >--- /dev/null >+++ b/t/cypress/integration/Patron/Address.ts >@@ -0,0 +1,44 @@ >+describe("Display address", () => { >+ beforeEach(() => { >+ cy.login(); >+ cy.title().should("eq", "Koha staff interface"); >+ cy.task("buildSampleObject", { >+ object: "patron", >+ values: { >+ street_number: 12, >+ street_type: "Rd", >+ address: "Awesome", >+ address2: "Library", >+ city: "Portland", >+ state: "OR", >+ postal_code: "44240", >+ country: "USA", >+ }, >+ }).then(generatedPatron => { >+ cy.task("insertObject", { >+ type: "patron", >+ object: generatedPatron, >+ }).then(objects_patron => { >+ cy.wrap(objects_patron).as("objects_patron"); >+ }); >+ }); >+ }); >+ >+ afterEach(function () { >+ cy.task("deleteSampleObjects", [this.objects_patron]); >+ }); >+ >+ it("should have correct spacing", function () { >+ cy.visit( >+ `/cgi-bin/koha/members/moremember.pl?borrowernumber=${this.objects_patron.patron_id}` >+ ); >+ const patron = this.objects_patron; >+ cy.get(".patronbriefinfo").should($el => { >+ const re = new RegExp( >+ `${patron.street_number} ${patron.address} ${patron.street_type}\\n\\s*${patron.address2}\\n\\s*${patron.city}, ${patron.state} ${patron.postal_code}\\n\\s*${patron.country}` >+ ); >+ const displayedText = $el.text().replace(/ /g, " ").trim(); >+ expect(displayedText).to.match(re); >+ }); >+ }); >+}); >-- >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 40320
:
183843
|
183940
|
183944