Summary: | KohaTable_spec.ts is failing | ||
---|---|---|---|
Product: | Koha | Reporter: | Jonathan Druart <jonathan.druart> |
Component: | Test Suite | Assignee: | Jonathan Druart <jonathan.druart> |
Status: | Pushed to main --- | QA Contact: | Lisette Scheer <lisette> |
Severity: | normal | ||
Priority: | P5 - low | CC: | lisette, lucas, matt.blenkinsop |
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
GIT URL: | Change sponsored?: | --- | |
Patch complexity: | --- | Documentation contact: | |
Documentation submission: | Text to go in the release notes: | ||
Version(s) released in: |
25.11.00
|
Circulation function: | |
Bug Depends on: | |||
Bug Blocks: | 40174 | ||
Attachments: |
Bug 40344: Fix KohaTable_spec.ts
Bug 40344: Fix KohaTable_spec.ts Bug 40344: Fix KohaTable_spec.ts |
Created attachment 183971 [details] [review] 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 Created attachment 184102 [details] [review] 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 <matt.blenkinsop@openfifth.co.uk> Created attachment 184156 [details] [review] 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 <matt.blenkinsop@openfifth.co.uk> Signed-off-by: Lisette Scheer <lisette@bywatersolutions.com> Nice work everyone! Pushed to main for 25.11 |
> Cannot read properties of undefined (reading 'description')