Bug 40981 - KohaTable/Holdings_spec.ts is failing randomly
Summary: KohaTable/Holdings_spec.ts is failing randomly
Status: Pushed to main
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: Lucas Gass (lukeg)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-09 09:26 UTC by Jonathan Druart
Modified: 2025-10-09 13:26 UTC (History)
1 user (show)

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


Attachments
Bug 40981: Prevent KohaTable/Holdings_spec.ts to fail randomly (4.40 KB, patch)
2025-10-09 09:33 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40981: Prevent KohaTable/Holdings_spec.ts to fail randomly (4.46 KB, patch)
2025-10-09 09:55 UTC, Jonathan Druart
Details | Diff | Splinter Review
Bug 40981: Prevent KohaTable/Holdings_spec.ts to fail randomly (4.51 KB, patch)
2025-10-09 13:05 UTC, Lucas Gass (lukeg)
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-10-09 09:26:19 UTC
The following error originated from your application code, not from Cypress.

  > DataTables warning detected in log: "DataTables warning: table id=holdings_table - Ajax error. For more information about this error, please see https://datatables.net/tn/7"
Comment 1 Jonathan Druart 2025-10-09 09:33:59 UTC
Created attachment 187647 [details] [review]
Bug 40981: Prevent KohaTable/Holdings_spec.ts to fail randomly

There is a JS warning raised by DT which makes the tests fail:
```
The following error originated from your application code, not from Cypress.

  > DataTables warning detected in log: "DataTables warning: table id=holdings_table - Ajax error. For more information about this error, please see https://datatables.net/tn/7"
```

It is caused by a 404 returned by the API, because DT receives the
response during the afterEach (after the objects have been deleted)

We must wait for the responses when needed.

Test plan:
  cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts
should still pass
Comment 2 Jonathan Druart 2025-10-09 09:55:11 UTC
Created attachment 187648 [details] [review]
Bug 40981: Prevent KohaTable/Holdings_spec.ts to fail randomly

There is a JS warning raised by DT which makes the tests fail:
```
The following error originated from your application code, not from Cypress.

  > DataTables warning detected in log: "DataTables warning: table id=holdings_table - Ajax error. For more information about this error, please see https://datatables.net/tn/7"
```

It is caused by a 404 returned by the API, because DT receives the
response during the afterEach (after the objects have been deleted)

We must wait for the responses when needed.

Test plan:
  cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts
should still pass
Comment 3 Lucas Gass (lukeg) 2025-10-09 13:05:26 UTC
Created attachment 187658 [details] [review]
Bug 40981: Prevent KohaTable/Holdings_spec.ts to fail randomly

There is a JS warning raised by DT which makes the tests fail:
```
The following error originated from your application code, not from Cypress.

  > DataTables warning detected in log: "DataTables warning: table id=holdings_table - Ajax error. For more information about this error, please see https://datatables.net/tn/7"
```

It is caused by a 404 returned by the API, because DT receives the
response during the afterEach (after the objects have been deleted)

We must wait for the responses when needed.

Test plan:
  cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts
should still pass

Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
Comment 4 Lucas Gass (lukeg) 2025-10-09 13:26:43 UTC
Pushed to main for 25.11.00