Bug 40344 - KohaTable_spec.ts is failing
Summary: KohaTable_spec.ts is failing
Status: Pushed to oldstable
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: unspecified
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Lisette Scheer
URL:
Keywords:
Depends on:
Blocks: 40174
  Show dependency treegraph
 
Reported: 2025-07-11 04:30 UTC by Jonathan Druart
Modified: 2025-08-01 09:37 UTC (History)
4 users (show)

See Also:
GIT URL:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
25.11.00,25.05.02,24.11.08
Circulation function:


Attachments
Bug 40344: Fix KohaTable_spec.ts (2.08 KB, patch)
2025-07-11 04:32 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40344: Fix KohaTable_spec.ts (2.15 KB, patch)
2025-07-15 13:39 UTC, Matt Blenkinsop
Details | Diff | Splinter Review
Bug 40344: Fix KohaTable_spec.ts (2.21 KB, patch)
2025-07-16 17:00 UTC, Lisette Scheer
Details | Diff | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Jonathan Druart 2025-07-11 04:30:22 UTC
> Cannot read properties of undefined (reading 'description')
Comment 1 Jonathan Druart 2025-07-11 04:32:37 UTC
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
Comment 2 Matt Blenkinsop 2025-07-15 13:39:48 UTC
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>
Comment 3 Lisette Scheer 2025-07-16 17:00:30 UTC
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>
Comment 4 Lucas Gass (lukeg) 2025-07-16 20:32:57 UTC
Nice work everyone!

Pushed to main for 25.11
Comment 5 Paul Derscheid 2025-07-24 08:20:44 UTC
Nice work everyone!

Pushed to 25.05.x
Comment 6 Fridolin Somers 2025-08-01 09:37:33 UTC
Pushed to 24.11.x for 24.11.08