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> Signed-off-by: Pedro Amorim <pedro.amorim@openfifth.co.uk> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> (cherry picked from commitb83df697de) Signed-off-by: Paul Derscheid <paul.derscheid@lmscloud.de> (cherry picked from commit98ca5b0800) Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>
This commit is contained in:
parent
2a26f2e137
commit
f54810d82b
|
|
@ -109,16 +109,13 @@ describe("catalogue/detail/holdings_table with items", () => {
|
|||
});
|
||||
});
|
||||
|
||||
afterEach(
|
||||
() =>
|
||||
function () {
|
||||
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
|
||||
|
|
@ -458,16 +455,13 @@ describe("catalogue/detail/holdings_table without items", () => {
|
|||
});
|
||||
});
|
||||
|
||||
afterEach(
|
||||
() =>
|
||||
function () {
|
||||
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
|
||||
|
|
|
|||
|
|
@ -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";
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue