Commit Graph

19 Commits

Author SHA1 Message Date
Martin Renvoize 04809de849
Bug 42764: Fix spelling errors across the codebase
Correct genuine spelling errors identified by the codespell 2.4.x
full scan after the KTD container OS upgrade. Changes are in
comments, POD, strings, and template text across 55 files.

"SAN Ouest Provence" (the French library co-operative and Koha
sponsor) is preserved as a proper noun. Perl copyright lines
receive an inline # codespell:ignore annotation; about.tt files
(contributor attribution pages) are added to the Koha::Devel::Files
codespell exception list so that future uses of "Provence" as a
typo for "Province" are still caught in all other files.

Notable user-visible fixes:
- "submiting" -> "submitting" in authority and bibliographic merge screens
- "deleteable" -> "deletable" in patron exception messages
- "Acquistions" -> "Acquisitions" in reports dictionary

Test plan:
1. Apply patches
2. In the staff interface, go to Cataloguing > Merge records and
   confirm the submit button reads "Submitting" (not "Submiting")
3. In the staff interface, go to Authorities > Merge and confirm
   the same correction
4. Attempt to delete a patron with outstanding issues and confirm
   the error message reads "deletable" (not "deleteable")
5. prove xt/author/codespell.t
=> All tests pass

Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk>
2026-06-03 16:09:04 +00:00
Tomas Cohen Arazi fbbeba87dc
Bug 40542: (40174 follow-up) Skip _strings for object creation
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-08-01 13:22:28 -06:00
Martin Renvoize d9122cd5ac
Bug 40447: Add comprehensive JSDoc documentation to Cypress plugins
This patch adds detailed JSDoc documentation to all Cypress testing
plugin files.

Documentation added to:
- insertData.js: Data insertion utilities with examples
- api-client.js: API wrapper functions with usage patterns
- mockData.js: Schema-based mock data generation
- auth.js: Authentication helper functions
- db.js: Database query utilities
- readYamlFile.js: YAML file reading utilities
- index.js: Main plugin configuration

Each function now includes:
- Complete parameter descriptions with types
- Return value documentation
- Practical usage examples
- Error conditions and handling
- Module-level overviews

This addresses the documentation gap identified during QA review,
hopefully making it easier for future devs to adopt the new framework of
tools.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:30 -06:00
Jonathan Druart 065f00ad67
Bug 40174: Do not generate bigint
Prevent "Out of range value for column 'deliverytime'" in a later
follow-up bug reports.

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:20 -06:00
Jonathan Druart 7f8e4fd4b5
Bug 40174: Set minLength to 3
When we generate several objects we often get "Duplicate ID" from the
server. This mostly happens when the tests failed previously and the
objects have not been removed from the DB.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:19 -06:00
Jonathan Druart da17bc0f91
Bug 40174: Deal with enum
Data too long for column 'checkprevcheckout'

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:18 -06:00
Jonathan Druart 892df0f0c0
Bug 40174: Allow proper E2E testing with Cypress
This is the first step toward implementing true end-to-end testing with
Cypress.

Until now, we have been mocking responses using cy.intercept(), but this
approach can lead to confusion. In some cases, we have even had to mock
global JavaScript variables, which makes the code unnecessarily complex
and unconventional (e.g. win.categories_map).

All the bug reports listed under this tree have helped lay the
groundwork for this patch. With it, we are able to build mock objects
(via plugin mockData) and insert them directly into the database
(insertData). Once the tests are complete, we’ll restore the database to
its previous state by removing any data generated during the tests.

The tests in KohaTable/Holdings_spec.ts have been updated to leverage
this new setup.

Additionally, a caching mechanism has been added to prevent _id
attributes from being generated with the same values (a rare issue we
occasionally encountered).

While this is still not a perfect solution, it introduces a solid
foundation for future improvements.

Test plan:
All Cypress tests must pass

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-21 14:01:17 -06:00
Jonathan Druart 0aaf193a75
Bug 40169: mockData - Do not replace _id if passed
If we build an object and pass a primary key (ie. suffixed by _id) we
should not replace it.

Test plan:
The test highlights the problem, it won't affect existing tests.
0. Apply only the first patch (Cypress tests)
1. Run yarn cypress run t/cypress/integration/t/mockData.ts
=> It fails
2. Apply this patch
=> It passes

Signed-off-by: David Nind <david@davidnind.com>

Amended-by: Jonathan Druart
Remove .only

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-07-15 16:32:54 -06:00
Jonathan Druart cb384b2a1c
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>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-04-14 08:50:54 +02:00
Koha Development Team d659526b5a
Bug 38664: Tidy the whole codebase
This commit is generated using:
  % perl misc/devel/tidy.pl
*within* ktd, to get the same version of perltidy than what will be used
by our CI (currently v20230309).

Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-02-11 14:58:24 +01:00
Jonathan Druart 55c3840588
Bug 38503: Do not generate too long strings
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-20 17:41:14 +01:00
Jonathan Druart 9f5f4aa1d6
Bug 38503: Do not list the objects
No need to list all the objects, just retrieve the spec depending on the
"object" var we pass.

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:21 +01:00
Jonathan Druart ddd22c7887
Bug 38503: Generate correct values for date and date-time
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:20 +01:00
Jonathan Druart 3bc9bd8b62
Bug 38503: Deal with types that can be "null"
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:20 +01:00
Jonathan Druart 34f6663374
Bug 38503: Allow to pass values
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:19 +01:00
Jonathan Druart 3f880c5978
Bug 38503: Have a generic buildSampleObject[s]
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:19 +01:00
Jonathan Druart 7b3426928f
Bug 38503: Same for libraries
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:18 +01:00
Jonathan Druart bad59ca734
Bug 38503: Implement a plural form - buildSamplePatrons
Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:18 +01:00
Jonathan Druart 3a3294966a
Bug 38503: Read patron swagger spec file and implement buildSamplePatron
Test plan:
1. Install deps
     sudo yarn install --modules-folder /kohadevbox/node_modules
2. Run tests
     cypress run --config video=false --spec t/cypress/integration/t/mockData.ts

Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
2025-01-16 15:27:17 +01:00