Commit Graph

8367 Commits

Author SHA1 Message Date
Nick Clemens 168f52f99b
Bug 34596: Unit tests
Writing these I found that transferbook was generating two queue rebuilds - fixed that

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-06 09:15:18 -06:00
Jonathan Druart fef3b93bbf
Bug 38201: Fix InfiniteScrollSelect_spec.ts
Same as
  commit 64a271992a
  Bug 38201: Improve Agreements/Edit tests

    It removes the following DT warning in the console

    DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'status' for row 0, column 4. For more information about this error, please see https://datatables.net/tn/4

    related to bug 40809

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-04 09:28:21 -06:00
Jonathan Druart 5873a68f64
Bug 38201: Fix codespell
koha-tmpl/intranet-tmpl/prog/js/vue/components/ERM/EHoldingsLocalTitleResource.vue:492: keywork ==> keyword
t/cypress/component/ShowElement_spec.ts:39: falsy ==> falsely, false

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
2025-10-03 11:53:02 +02:00
Matt Blenkinsop 56cf8508a4
Bug 38201: Fix Dataproviders_spec.ts
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:34 -06:00
Jonathan Druart 4edf8e5b7a
Bug 38201: Remove DT warnings from Cypress tests
(cherry picked from commit b2a779e12f3ae23e10cba6177f248e12263306f8)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:34 -06:00
Jonathan Druart 64a271992a
Bug 38201: Improve Agreements/Edit tests
It removes the following DT warning in the console

DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'status' for row 0, column 4. For more information about this error, please see https://datatables.net/tn/4

related to bug 40809

(cherry picked from commit bc0ad04dddbe8e3462238a14b0e9e5caaa3cdfd7)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:32 -06:00
Jonathan Druart a5af4008e4
Bug 38201: Add missing newlines at end of file
(cherry picked from commit d5a9d6ebcc8ef5fd5189a3c91df5c0899d440aef)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:32 -06:00
Jonathan Druart 6c202ed580
Bug 38201: Remove cy.wait(500)
Statements removed by bug 40051 but reintroduced by a commit earlier

(cherry picked from commit ab8914358f97bd4e78b20490e5741f87e40ebb15)
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:31 -06:00
Matt Blenkinsop 35ce755ed8
Bug 38201: Cypress fixes
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:30 -06:00
Matt Blenkinsop 141e05bff3
Bug 38201: Make all framework tests db independent
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:29 -06:00
Matt Blenkinsop 604257569f
Bug 38201: Cypress fixes
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:27 -06:00
Matt Blenkinsop 040550bed8
Bug 38201: Update unit tests for split pane mode
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:26 -06:00
Jonathan Druart 8724b98c51
Bug 38201: Load Cypress components - componentPath
(cherry picked from commit 0fc12a0b7875b4bf0b77c200946516c1bd2092e0)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:23 -06:00
Jonathan Druart 70b7bb0f33
Bug 38201: Move cypress components under t/cypress
(cherry picked from commit 5cf8a60eb99e37abc365639d05e9da9ca931f7d6)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:23 -06:00
Matt Blenkinsop d93e01850a
Bug 38201: Add component tests for useBaseResource
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:21 -06:00
Matt Blenkinsop 37076455ff
Bug 38201: Add component tests for FormElement
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:20 -06:00
Matt Blenkinsop 5a3aacf1c6
Bug 38201: Use Vue alias for imports
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:19 -06:00
Matt Blenkinsop bf614927a8
Bug 38201: Mock the router for component testing
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:19 -06:00
Jonathan Druart 65fd882fa8
Bug 38201: install i18n on mount for component testing
(cherry picked from commit 5a78bc6fbfcb25d5b62e029f2cb6feacf17e8396)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:18 -06:00
Matt Blenkinsop 40c08f81df
Bug 38201: Add framework tests for ResourceFormSave
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:17 -06:00
Matt Blenkinsop 0edc8702aa
Bug 38201: Add component tests for ShowElement
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:17 -06:00
Matt Blenkinsop 109804e163
Bug 38201: Add VueFramework cypress tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:16 -06:00
Matt Blenkinsop 3dbd768efd
Bug 38201: DRY out cypress object deletion
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:15 -06:00
Matt Blenkinsop f3699af0f0
Bug 38201: Add cypress tests for breadcrumbs
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:15 -06:00
Matt Blenkinsop 9e1fa0ac77
Bug 38201: Fix cypress tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:11 -06:00
Jonathan Druart 83f991cf8c
Bug 38201: Restore access to the preservation module when not configured
(cherry picked from commit b076ae88fe502a51f30b078ede6cb7e952dea670)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:04 -06:00
Jonathan Druart 01cdc32694
Bug 38201: Do not freeze the app if ERMModule is turned off
(cherry picked from commit 75ed8ac404797514dc5ed615c3b1e21b6abf58ae)
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:04 -06:00
Matt Blenkinsop 5677734c09
Bug 38201: Fix cypress tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:40:02 -06:00
Pedro Amorim 586e24ad6d
Bug 38201: Update Cypress tests
perl /kohadevbox/misc4dev/run_tests.pl --run-cypress-tests-only

All passing

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:39:10 -06:00
Matt Blenkinsop 52398c0122
Bug 38201: Update cypress tests
Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:39:05 -06:00
Pedro Amorim eec04d890c
Bug 38201: (QA follow-up): Fix Dialog_spec.ts
Run the test spec before and after applying the patch:
cypress run --spec t/cypress/integration/ERM/Dialog_spec.ts

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:29 -06:00
Pedro Amorim 46bccdc142
Bug 38201: Update cypress
Local packages were named 'package' on the delete confirmation dialog, but 'local package' on the deleted confirmation message.
Both these places now use the same i18n.display_name from the respective Resource component so these label tests need to be updated.
Same for local titles.

Test plan:
cypress run --spec t/cypress/integration/ERM/DataProviders_spec.ts
cypress run --spec t/cypress/integration/ERM/Agreements_spec.ts
cypress run --spec t/cypress/integration/ERM/Licenses_spec.ts
cypress run --spec t/cypress/integration/ERM/Titles_spec.ts
cypress run --spec t/cypress/integration/ERM/Packages_spec.ts

Signed-off-by: Michaela Sieber <michaela.sieber@kit.edu>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 09:38:29 -06:00
Lucas Gass b7cb04b925
Revert "Bug 40286: Make C4::Auth::checkpw_internal use Koha::Patrons->find_by_identifier"
This reverts commit 4d748a390c.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-02 06:02:02 -06:00
Lucas Gass 2fb76a3a5e
Bug 38936: Use https in license
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-10-01 08:32:49 -06:00
Tomas Cohen Arazi 4d748a390c
Bug 40286: Make C4::Auth::checkpw_internal use Koha::Patrons->find_by_identifier
This patch does what the title says. The code change is clear to
understand.

The check for userid vs. cardnumber is done in the `find_by_identifier`
method so no need to do it here.

Note: When `find_by_identifier` was written, I picked some other place's
logic (API password validation) so `userid` is used first for finding
the patron. Because of this, tests in t/db_dependent/Auth.t need to be
adjusted. I believe this is not an issue, as those tests should be
removed once we move forward with bug 33905, entirely.

To test:
1. Apply this patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Auth.t
=> SUCCESS: Tests pass!
3. Sign off :-D

Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:30 -06:00
Pedro Amorim 46ffd07b85
Bug 40171: Add tests
prove t/db_dependent/Koha/ILL/Requests.t

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:30 -06:00
Jonathan Druart be0dd91c41
Bug 40320: Use insertSamplePatron
On
  commit 959b7e8f05
  Bug 40345: Add insertSamplePatron

We remove the ability to insert a patron using insertObject, we need to
use insertSamplePatron instead.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:29 -06:00
Jonathan Druart 67e04b039a
Bug 40320: (bug 40319 follow-up) Add Cypress tests
Test plan:
Make sure the display of city, state and zipcode is the same as before
the patch
Confirm that the new Cypress tests pass

Signed-off-by: Owen Leonard <oleonard@myacpl.org>

Amended-by: Jonathan Druart
Added $raw filter to [% ", " %]

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:29 -06:00
Marcel de Rooy ce787a272d
Bug 39145: (follow-up) Tidy files
No test plan (just result of perltidy).

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:26 -06:00
Marcel de Rooy d8ca65d37b
Bug 39145: Add unit tests
Test plan:
Run t/db_dependent/Koha/Virtualshelves.t

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:25 -06:00
Jonathan Druart c9af16546b
Bug 38936: Remove local WARN
We now have Test::NoWarnings

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:23 -06:00
Tomas Cohen Arazi 248604d588
Bug 38936: Unit tests
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:22 -06:00
Tomás Cohen Arazi 633f84b57b
Bug 40856: Add unit tests for Standard backend metadata method
This patch adds comprehensive unit tests for the metadata() method in the
Standard ILL backend to establish baseline behavior before optimization.

The tests cover:
- Metadata structure (returns hashref)
- Included attributes (title, author, isbn, year, custom fields)
- Excluded attributes (ignored fields like requested_partners, type, etc.)
- Display name transformation (attribute types become display names)

Current behavior tested:
- metadata() filters out predefined ignore list attributes
- Uses linear search with grep for each attribute
- Transforms attribute types to display names (title -> Title)
- Custom fields get ucfirst transformation (custom_field -> Custom_field)
- Returns hashref with display names as keys

These tests document the current inefficient implementation and will
ensure the upcoming optimization maintains compatibility.

Test plan:
1. Apply patch
2. Run:
   $ ktd --shell
  k$ prove t/db_dependent/Koha/ILL/Backend/Standard.t
=> SUCCESS: Tests pass! Current metadata behavior documented
3. Tests establish baseline for upcoming optimization
4. Sign off :-D

Signed-off-by: Martin Renvoize <martin.renvoize@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:20 -06:00
Martin Renvoize de3f1abae8
Bug 38330: (QA follow-up) Remove use of metadata_extractor
We had a local method for getting opac_suppressed in Koha::Biblio which
relied on extracting from the MARC record.  Now that we have an
opac_suppressed field in the Biblio table, we no longer need this
wrapper method.

Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-29 14:02:15 -06:00
Jonathan Druart f8138a73e8
Bug 40809: Also logs args in the console
For an unknown reason there are useful data that are displayed when
using console.log that we don't see when throwing the Error
This was the purpose of the previous patch (to have everything in
Error) but it didn't work. However we can keep it.

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:37:07 -06:00
Jonathan Druart c481c6d081
Bug 40809: Display the whole error
Not only the first line

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:37:06 -06:00
Jonathan Druart 187a9b3572
Bug 40809: Fail on DataTables 'warnings'
They are not in the warn buffer but log
DataTables warning: table id=DataTables_Table_0 - Requested unknown parameter 'status' for row 0, column 4. For more information about this error, please see https://datatables.net/tn/4

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:37:05 -06:00
Jonathan Druart 4043e03cd6
Bug 40809: Fail Cypress tests on JS warnings
Currently JS warnings during Cypress tests are ignored.
This change intercepts console warnings in the browser and if any occurs
the test failed

This helps catch potential issues and ensures that warnings are not
silently ignored during test runs.

Signed-off-by: Matt Blenkinsop <matt.blenkinsop@openfifth.co.uk>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:37:05 -06:00
Jonathan Druart d996664353
Bug 40467: Remove t/00-deprecated.t
it only tests for the presence of "switch"

Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Tomás Cohen Arazi <tomascohen@theke.io>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:37:04 -06:00
Jonathan Druart 93a78880cb
Bug 40865: Add a cypress test
Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
2025-09-26 10:36:55 -06:00