From fb1a9adff3c868264630c47f8ca00eda0189b1c4 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 11 Jul 2025 06:30:26 +0200 Subject: [PATCH] Bug 40344: Fix KohaTable_spec.ts > Cannot read properties of undefined (reading 'description') Not sure since which change this is failing but it has always been wrong. The code in patron-search.inc is: var categories = [% To.json(categories) | $raw %].map(e => { e['_id'] = e.categorycode.toLowerCase(); e['_str'] = e.description; return e; }); var categories_map = categories.reduce((map, e) => { map[e._id] = e; return map; }, {}); It's the keys that are lower cased. Test plan: `yarn cypress run \ --config video=false,screenshotOnRunFailure=false \ --spec t/cypress/integration/KohaTable/KohaTable_spec.ts` should return green Signed-off-by: Matt Blenkinsop Signed-off-by: Lisette Scheer --- t/cypress/integration/KohaTable/KohaTable_spec.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/cypress/integration/KohaTable/KohaTable_spec.ts b/t/cypress/integration/KohaTable/KohaTable_spec.ts index 035404c11ae..3c0ca843fd6 100644 --- a/t/cypress/integration/KohaTable/KohaTable_spec.ts +++ b/t/cypress/integration/KohaTable/KohaTable_spec.ts @@ -333,7 +333,7 @@ describe("kohaTable (using REST API)", () => { cy.window().then(win => { win.categories_map = patrons.reduce((map, p) => { - map[p.category_id] = p.category_id; + map[p.category_id.toLowerCase()] = p.category_id; return map; }, {}); }); @@ -399,7 +399,7 @@ describe("kohaTable (using REST API)", () => { cy.window().then(win => { win.categories_map = patrons.reduce((map, p) => { - map[p.category_id] = p.category_id; + map[p.category_id.toLowerCase()] = p.category_id; return map; }, {}); }); -- 2.39.5