From 78fa573d8feebbd74ba0398be670648b5f05a66d Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 26 Sep 2025 21:41:22 +0200 Subject: [PATCH] Bug 40320: Use insertSamplePatron On commit 959b7e8f05059522151fb24992ed7250ac436dc1 Bug 40345: Add insertSamplePatron We remove the ability to insert a patron using insertObject, we need to use insertSamplePatron instead. --- t/cypress/integration/Patron/Address.ts | 27 +++++-------------------- 1 file changed, 5 insertions(+), 22 deletions(-) diff --git a/t/cypress/integration/Patron/Address.ts b/t/cypress/integration/Patron/Address.ts index 1d09a43690c..95667877678 100644 --- a/t/cypress/integration/Patron/Address.ts +++ b/t/cypress/integration/Patron/Address.ts @@ -2,37 +2,20 @@ 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"); - }); + cy.task("insertSamplePatron").then(objects_patron => { + cy.wrap(objects_patron).as("objects_patron"); }); }); afterEach(function () { - cy.task("deleteSampleObjects", [this.objects_patron]); + cy.task("deleteSampleObjects", this.objects_patron); }); it("should have correct spacing", function () { + const patron = this.objects_patron.patron; cy.visit( - `/cgi-bin/koha/members/moremember.pl?borrowernumber=${this.objects_patron.patron_id}` + `/cgi-bin/koha/members/moremember.pl?borrowernumber=${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}` -- 2.34.1