Bugzilla – Attachment 183988 Details for
Bug 40345
Missing Cypress tests for checkout history - OPAC
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40345: Use then to prevent async issues
Bug-40345-Use-then-to-prevent-async-issues.patch (text/plain), 3.43 KB, created by
Jonathan Druart
on 2025-07-11 12:16:26 UTC
(
hide
)
Description:
Bug 40345: Use then to prevent async issues
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-11 12:16:26 UTC
Size:
3.43 KB
patch
obsolete
>From 131bdb1725e454e2f709cc18cf97c140222fe75c Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 11 Jul 2025 14:08:02 +0200 >Subject: [PATCH] Bug 40345: Use then to prevent async issues > >--- > .../KohaTable/OPACCirculationHistory_spec.ts | 50 +++++++++++-------- > 1 file changed, 29 insertions(+), 21 deletions(-) > >diff --git a/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts b/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts >index 56f0c43c95f..4e6786ca4fe 100644 >--- a/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts >+++ b/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts >@@ -1,35 +1,43 @@ > describe("opac-readingrecord", () => { > beforeEach(() => { >+ cy.loginOpac(); > let objects_to_cleanup = []; > cy.task("apiGet", { > endpoint: "/api/v1/patrons/51", >- }).then(patron => { >- [...Array(51)].forEach(() => { >- cy.task("insertSampleCheckout", { >- patron: patron, >- }).then(objects_checkout => { >- cy.task("query", { >- sql: "INSERT INTO old_issues SELECT * FROM issues WHERE issue_id=?", >- values: [objects_checkout.checkout.checkout_id], >- }); >- cy.task("query", { >- sql: "DELETE FROM issues WHERE issue_id=?", >- values: [objects_checkout.checkout.checkout_id], >+ }) >+ .then(patron => { >+ [...Array(51)].forEach(() => { >+ cy.task("insertSampleCheckout", { >+ patron: patron, >+ }).then(objects_checkout => { >+ cy.task("query", { >+ sql: "INSERT INTO old_issues SELECT * FROM issues WHERE issue_id=?", >+ values: [objects_checkout.checkout.checkout_id], >+ }) >+ .then(() => { >+ cy.task("query", { >+ sql: "DELETE FROM issues WHERE issue_id=?", >+ values: [ >+ objects_checkout.checkout.checkout_id, >+ ], >+ }); >+ }) >+ .then(() => { >+ objects_checkout.old_checkout = >+ objects_checkout.checkout; >+ delete objects_checkout.checkout; >+ objects_to_cleanup.push(objects_checkout); >+ }); > }); >- objects_checkout.old_checkout = objects_checkout.checkout; >- delete objects_checkout.checkout; >- objects_to_cleanup.push(objects_checkout); > }); >+ }) >+ .then(() => { >+ cy.wrap(objects_to_cleanup).as("objects_to_cleanup"); > }); >- >- cy.wrap(objects_to_cleanup).as("objects_to_cleanup"); >- }); >- >- cy.loginOpac(); > }); > > afterEach(function () { >- cy.task("deleteSampleObjects", [this.objects_to_cleanup]); >+ cy.task("deleteSampleObjects", this.objects_to_cleanup); > }); > > it("50 items should be displayed by default", function () { >-- >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 40345
:
183974
|
183975
|
183976
|
183977
|
183979
|
183983
|
183984
|
183985
|
183986
|
183987
| 183988