Bugzilla – Attachment 183979 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: Properly cleanup old checkouts
Bug-40345-Properly-cleanup-old-checkouts.patch (text/plain), 2.87 KB, created by
Jonathan Druart
on 2025-07-11 09:16:28 UTC
(
hide
)
Description:
Bug 40345: Properly cleanup old checkouts
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2025-07-11 09:16:28 UTC
Size:
2.87 KB
patch
obsolete
>From 09ace862903feb999f0b05653178b1a6d7c3bd42 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Fri, 11 Jul 2025 11:15:56 +0200 >Subject: [PATCH] Bug 40345: Properly cleanup old checkouts > >--- > .../integration/KohaTable/OPACCirculationHistory_spec.ts | 4 +++- > t/cypress/plugins/insertData.js | 9 +++++++++ > 2 files changed, 12 insertions(+), 1 deletion(-) > >diff --git a/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts b/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts >index 04c0a7bd603..56f0c43c95f 100644 >--- a/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts >+++ b/t/cypress/integration/KohaTable/OPACCirculationHistory_spec.ts >@@ -8,7 +8,6 @@ describe("opac-readingrecord", () => { > cy.task("insertSampleCheckout", { > patron: patron, > }).then(objects_checkout => { >- objects_to_cleanup.push(objects_checkout); > cy.task("query", { > sql: "INSERT INTO old_issues SELECT * FROM issues WHERE issue_id=?", > values: [objects_checkout.checkout.checkout_id], >@@ -17,6 +16,9 @@ describe("opac-readingrecord", () => { > sql: "DELETE FROM issues WHERE issue_id=?", > values: [objects_checkout.checkout.checkout_id], > }); >+ objects_checkout.old_checkout = objects_checkout.checkout; >+ delete objects_checkout.checkout; >+ objects_to_cleanup.push(objects_checkout); > }); > }); > >diff --git a/t/cypress/plugins/insertData.js b/t/cypress/plugins/insertData.js >index bc92c26bad7..85915306098 100644 >--- a/t/cypress/plugins/insertData.js >+++ b/t/cypress/plugins/insertData.js >@@ -332,6 +332,7 @@ const deleteSampleObjects = async allObjects => { > const pluralMap = { > hold: "holds", > checkout: "checkouts", >+ old_checkout: "old_checkouts", > patron: "patrons", > item: "items", > biblio: "biblios", >@@ -358,6 +359,7 @@ const deleteSampleObjects = async allObjects => { > const deletionOrder = [ > "holds", > "checkouts", >+ "old_checkouts", > "patrons", > "items", > "biblios", >@@ -408,6 +410,13 @@ const deleteSampleObjects = async allObjects => { > values: ids, > }); > break; >+ case "old_checkouts": >+ ids = objects.map(i => i.checkout_id); >+ await query({ >+ sql: `DELETE FROM old_issues WHERE issue_id IN (${ids.map(() => "?").join(",")})`, >+ values: ids, >+ }); >+ break; > case "item_types": > ids = objects.map(i => i.item_type_id); > await query({ >-- >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