Bug 39315 - Missing tests for KohaTable search on coded value's description
Summary: Missing tests for KohaTable search on coded value's description
Status: Signed Off
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: Testopia
URL:
Keywords:
Depends on: 38108 39011
Blocks:
  Show dependency treegraph
 
Reported: 2025-03-12 12:16 UTC by Jonathan Druart
Modified: 2025-03-16 17:25 UTC (History)
1 user (show)

See Also:
Change sponsored?: ---
Patch complexity: ---
Documentation contact:
Documentation submission:
Text to go in the release notes:
Version(s) released in:
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

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