Bugzilla – Attachment 183357 Details for
Bug 40168
afterEach not called in KohaTable cypress tests
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 40168: Restore afterEach in KohaTable Cypress tests
Bug-40168-Restore-afterEach-in-KohaTable-Cypress-t.patch (text/plain), 3.50 KB, created by
David Nind
on 2025-06-18 21:25:26 UTC
(
hide
)
Description:
Bug 40168: Restore afterEach in KohaTable Cypress tests
Filename:
MIME Type:
Creator:
David Nind
Created:
2025-06-18 21:25:26 UTC
Size:
3.50 KB
patch
obsolete
>From 59e7c1ac69d489563ff1ea18c8ecd1cf302e78ba Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Jun 2025 16:06:57 +0200 >Subject: [PATCH] Bug 40168: Restore afterEach in KohaTable Cypress tests > >We defined an anonymous function inside an arrow function, and Cypress does not call it. > >Test plan: >Set AlwaysShowHoldingsTableFilters to "Do not" >Run t/cypress/integration/KohaTable/Holdings_spec.ts: > yarn cypress run --spec t/cypress/integration/KohaTable/Holdings_spec.ts > >When done, have a look at the value of AlwaysShowHoldingsTableFilters >=> without this patch it has been modified (not restored) and is set to >"Do" >=> With this patch applied the original value is restored at the end of >the tests (actually the end of each test) > >Signed-off-by: David Nind <david@davidnind.com> >--- > .../integration/KohaTable/Holdings_spec.ts | 34 ++++++++----------- > .../KohaTable/PatronSearch_spec.ts | 17 ++++------ > 2 files changed, 21 insertions(+), 30 deletions(-) > >diff --git a/t/cypress/integration/KohaTable/Holdings_spec.ts b/t/cypress/integration/KohaTable/Holdings_spec.ts >index f39e51e0e7..8011d0b8b1 100644 >--- a/t/cypress/integration/KohaTable/Holdings_spec.ts >+++ b/t/cypress/integration/KohaTable/Holdings_spec.ts >@@ -109,16 +109,13 @@ describe("catalogue/detail/holdings_table with items", () => { > }); > }); > >- afterEach( >- () => >- function () { >- cleanup(); >- cy.set_syspref( >- "AlwaysShowHoldingsTableFilters", >- this.syspref_AlwaysShowHoldingsTableFilters >- ); >- } >- ); >+ afterEach(function () { >+ cleanup(); >+ cy.set_syspref( >+ "AlwaysShowHoldingsTableFilters", >+ this.syspref_AlwaysShowHoldingsTableFilters >+ ); >+ }); > > it("Correctly init the table", function () { > // Do not use `() => {` or this.biblio_id won't be retrieved >@@ -502,16 +499,13 @@ describe("catalogue/detail/holdings_table without items", () => { > }); > }); > >- afterEach( >- () => >- function () { >- cleanup(); >- cy.set_syspref( >- "AlwaysShowHoldingsTableFilters", >- this.syspref_AlwaysShowHoldingsTableFilters >- ); >- } >- ); >+ afterEach(function () { >+ cleanup(); >+ cy.set_syspref( >+ "AlwaysShowHoldingsTableFilters", >+ this.syspref_AlwaysShowHoldingsTableFilters >+ ); >+ }); > > it("Do not display the table", function () { > // Do not use `() => {` or this.biblio_id won't be retrieved >diff --git a/t/cypress/integration/KohaTable/PatronSearch_spec.ts b/t/cypress/integration/KohaTable/PatronSearch_spec.ts >index b706f1eb80..a9cc064f40 100644 >--- a/t/cypress/integration/KohaTable/PatronSearch_spec.ts >+++ b/t/cypress/integration/KohaTable/PatronSearch_spec.ts >@@ -26,16 +26,13 @@ describe("ExtendedPatronAttributes", () => { > }); > }); > >- afterEach( >- () => >- function () { >- cleanup(); >- cy.set_syspref( >- "ExtendedPatronAttributes", >- this.syspref_ExtendedPatronAttributes >- ); >- } >- ); >+ afterEach(function () { >+ cleanup(); >+ cy.set_syspref( >+ "ExtendedPatronAttributes", >+ this.syspref_ExtendedPatronAttributes >+ ); >+ }); > > const table_id = "memberresultst"; > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 40168
:
183348
|
183349
| 183357 |
183358