Bug 39315 - Missing tests for KohaTable search on coded value's description
Summary: Missing tests for KohaTable search on coded value's description
Status: Pushed to main
Alias: None
Product: Koha
Classification: Unclassified
Component: Test Suite (show other bugs)
Version: Main
Hardware: All All
: P5 - low normal
Assignee: Jonathan Druart
QA Contact: Martin Renvoize (ashimema)
URL:
Keywords:
Depends on: 38108 39011
Blocks:
  Show dependency treegraph
 
Reported: 2025-03-12 12:16 UTC by Jonathan Druart
Modified: 2025-04-14 06:52 UTC (History)
2 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.05.00
Circulation function:


Attachments
Bug 39315: Move KohaTable cypress tests to a separate directory (1.06 KB, patch)
2025-03-12 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39315: Move holdings Cypress tests to a separate file (31.23 KB, patch)
2025-03-12 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39315: MockData - generate full objects for libraries and item types (4.09 KB, patch)
2025-03-12 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39315: (bug 38108 follow-up) Add Cypress tests (8.54 KB, patch)
2025-03-12 12:24 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39315: Move KohaTable cypress tests to a separate directory (1.11 KB, patch)
2025-03-16 17:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: Move holdings Cypress tests to a separate file (31.27 KB, patch)
2025-03-16 17:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: MockData - generate full objects for libraries and item types (4.13 KB, patch)
2025-03-16 17:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: (bug 38108 follow-up) Add Cypress tests (8.58 KB, patch)
2025-03-16 17:20 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: (bug 38108 follow-up) Add Cypress tests (8.58 KB, patch)
2025-04-02 10:18 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 39315: Move KohaTable cypress tests to a separate directory (1.11 KB, patch)
2025-04-02 12:38 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: Move holdings Cypress tests to a separate file (31.27 KB, patch)
2025-04-02 12:38 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: MockData - generate full objects for libraries and item types (4.13 KB, patch)
2025-04-02 12:38 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: (bug 38108 follow-up) Add Cypress tests (8.58 KB, patch)
2025-04-02 12:38 UTC, David Nind
Details | Diff | Splinter Review
Bug 39315: Move KohaTable cypress tests to a separate directory (1.17 KB, patch)
2025-04-02 13:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: Move holdings Cypress tests to a separate file (31.34 KB, patch)
2025-04-02 13:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: MockData - generate full objects for libraries and item types (4.20 KB, patch)
2025-04-02 13:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: (bug 38108 follow-up) Add Cypress tests (8.65 KB, patch)
2025-04-02 13:44 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: Move KohaTable cypress tests to a separate directory (1.17 KB, patch)
2025-04-02 14:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: Move holdings Cypress tests to a separate file (31.34 KB, patch)
2025-04-02 14:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: MockData - generate full objects for libraries and item types (4.20 KB, patch)
2025-04-02 14:10 UTC, Martin Renvoize (ashimema)
Details | Diff | Splinter Review
Bug 39315: (bug 38108 follow-up) Add Cypress tests (8.65 KB, patch)
2025-04-02 14:10 UTC, Martin Renvoize (ashimema)
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-03-12 12:16:24 UTC
On bug 39011 we added the ability to search on the coded value description, but the changes have not been covered by tests.
Comment 1 Jonathan Druart 2025-03-12 12:18:54 UTC
Depends on Cypress tests from bug 38108.
Comment 2 Jonathan Druart 2025-03-12 12:24:34 UTC
Created attachment 179201 [details] [review]
Bug 39315: Move KohaTable cypress tests to a separate directory
Comment 3 Jonathan Druart 2025-03-12 12:24:36 UTC
Created attachment 179202 [details] [review]
Bug 39315: Move holdings Cypress tests to a separate file
Comment 4 Jonathan Druart 2025-03-12 12:24:38 UTC
Created attachment 179203 [details] [review]
Bug 39315: MockData - generate full objects for libraries and item types
Comment 5 Jonathan Druart 2025-03-12 12:24:41 UTC
Created attachment 179204 [details] [review]
Bug 39315: (bug 38108 follow-up) Add Cypress tests

1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts
Comment 6 David Nind 2025-03-16 17:20:12 UTC
Created attachment 179365 [details] [review]
Bug 39315: Move KohaTable cypress tests to a separate directory

Signed-off-by: David Nind <david@davidnind.com>
Comment 7 David Nind 2025-03-16 17:20:15 UTC
Created attachment 179366 [details] [review]
Bug 39315: Move holdings Cypress tests to a separate file

Signed-off-by: David Nind <david@davidnind.com>
Comment 8 David Nind 2025-03-16 17:20:18 UTC
Created attachment 179367 [details] [review]
Bug 39315: MockData - generate full objects for libraries and item types

Signed-off-by: David Nind <david@davidnind.com>
Comment 9 David Nind 2025-03-16 17:20:21 UTC
Created attachment 179368 [details] [review]
Bug 39315: (bug 38108 follow-up) Add Cypress tests

1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts

Signed-off-by: David Nind <david@davidnind.com>
Comment 10 David Nind 2025-03-16 17:25:08 UTC
Testing notes (using KTD):

1. When applying patches for dependency 38108, use interactive mode and comment out all patches except the last one (Add Cypress tests), otherwise the patches don't apply cleanly (all the other patches for the dependency are already in main).

2. Running the tests - these should all pass (there was an incorrect path in the test plan for PatronSearch_spec.ts):
   - yarn cypress run --spec t/cypress/integration/t/mockData.ts
   - yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts
   - yarn cypress run --spec t/cypress/integration/KohaTable/KohaTable_spec.ts
   - yarn cypress run --spec t/cypress/integration/KohaTable/PatronSearch_spec.ts

3. When I run the tests in step 2, they all pass. However, I get this error (both before and after):

   DevTools listening on ws://127.0.0.1:40643/devtools/browser/4b47ab3b-14a7-4a1f-ac7d-cb9008446e76
   [9571:0316/171820.196254:ERROR:gpu_memory_buffer_support_x11.cc(44)] dri3 extension not supported.
   Missing baseUrl in compilerOptions. tsconfig-paths will be skipped
Comment 11 Martin Renvoize (ashimema) 2025-04-02 09:02:02 UTC
Hmm.. QA script doesn't like something here:

 FAIL   t/cypress/integration/KohaTable/Holdings_spec.ts
   FAIL   forbidden patterns
                forbidden pattern: .only detected (line 272)
Comment 12 Jonathan Druart 2025-04-02 10:18:53 UTC
Created attachment 180285 [details] [review]
Bug 39315: (bug 38108 follow-up) Add Cypress tests

1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts

Signed-off-by: David Nind <david@davidnind.com>
Comment 13 Jonathan Druart 2025-04-02 10:19:20 UTC
(In reply to Martin Renvoize (ashimema) from comment #11)
> Hmm.. QA script doesn't like something here:
> 
>  FAIL   t/cypress/integration/KohaTable/Holdings_spec.ts
>    FAIL   forbidden patterns
>                 forbidden pattern: .only detected (line 272)

Oops sorry about that. I knew it was a good idea to add this test :D
Comment 14 David Nind 2025-04-02 12:38:25 UTC
Created attachment 180317 [details] [review]
Bug 39315: Move KohaTable cypress tests to a separate directory

Signed-off-by: David Nind <david@davidnind.com>
Comment 15 David Nind 2025-04-02 12:38:28 UTC
Created attachment 180318 [details] [review]
Bug 39315: Move holdings Cypress tests to a separate file

Signed-off-by: David Nind <david@davidnind.com>
Comment 16 David Nind 2025-04-02 12:38:30 UTC
Created attachment 180319 [details] [review]
Bug 39315: MockData - generate full objects for libraries and item types

Signed-off-by: David Nind <david@davidnind.com>
Comment 17 David Nind 2025-04-02 12:38:33 UTC
Created attachment 180320 [details] [review]
Bug 39315: (bug 38108 follow-up) Add Cypress tests

1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts

Signed-off-by: David Nind <david@davidnind.com>
Comment 18 Martin Renvoize (ashimema) 2025-04-02 13:44:32 UTC
Created attachment 180371 [details] [review]
Bug 39315: Move KohaTable cypress tests to a separate directory

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 19 Martin Renvoize (ashimema) 2025-04-02 13:44:35 UTC
Created attachment 180372 [details] [review]
Bug 39315: Move holdings Cypress tests to a separate file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 20 Martin Renvoize (ashimema) 2025-04-02 13:44:38 UTC
Created attachment 180373 [details] [review]
Bug 39315: MockData - generate full objects for libraries and item types

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 21 Martin Renvoize (ashimema) 2025-04-02 13:44:41 UTC
Created attachment 180374 [details] [review]
Bug 39315: (bug 38108 follow-up) Add Cypress tests

1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 22 Martin Renvoize (ashimema) 2025-04-02 14:03:07 UTC
Tests, tests, all the tests :)
Comment 23 Martin Renvoize (ashimema) 2025-04-02 14:10:02 UTC
Created attachment 180386 [details] [review]
Bug 39315: Move KohaTable cypress tests to a separate directory

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 24 Martin Renvoize (ashimema) 2025-04-02 14:10:05 UTC
Created attachment 180387 [details] [review]
Bug 39315: Move holdings Cypress tests to a separate file

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 25 Martin Renvoize (ashimema) 2025-04-02 14:10:08 UTC
Created attachment 180388 [details] [review]
Bug 39315: MockData - generate full objects for libraries and item types

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 26 Martin Renvoize (ashimema) 2025-04-02 14:10:10 UTC
Created attachment 180389 [details] [review]
Bug 39315: (bug 38108 follow-up) Add Cypress tests

1. We move from const to var so that we can modify the value of the
variable from the Cypress tests.

2. Also remove win.libraries_map as it seems that our code is no longer
failing if it's missing (we added more checks I guess)

3. Improved selectors for the show/hide filters links
-                    cy.get(".hide_filters").click();
+                    cy.get(`.${table_id}_table_controls .hide_filters`).click();

Test plan:
Both commands should pass
 yarn cypress run --spec t/cypress/integration/PatronSearch_spec.ts
 yarn cypress run --spec t/cypress/integration/t/mockData.ts

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Comment 27 Katrin Fischer 2025-04-14 06:52:50 UTC
Pushed for 25.05!

Well done everyone, thank you!