Bug 33408: Mock ERM sysprefs from cypress tests

Sponsored-by: BULAC - http://www.bulac.fr/
Signed-off-by: Pedro Amorim <pedro.amorim@ptfs-europe.com>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io>
This commit is contained in:
Jonathan Druart 2023-04-04 17:02:12 +02:00 committed by Tomas Cohen Arazi
parent 9be7dab4a1
commit 2579b95db9
No known key found for this signature in database
GPG Key ID: 0A272EA1B2F3C15F
5 changed files with 10 additions and 30 deletions

View File

@ -118,8 +118,8 @@ function get_licenses_to_relate() {
describe("Agreement CRUD operations", () => {
before(() => {
cy.fetch_initial_ERM_sys_pref_value();
cy.set_ERM_sys_pref_value(true);
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}');
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}');
});
beforeEach(() => {
@ -127,10 +127,6 @@ describe("Agreement CRUD operations", () => {
cy.title().should("eq", "Koha staff interface");
});
after(() => {
cy.reset_initial_ERM_sys_pref_value();
});
it("List agreements", () => {
// GET agreements returns 500
cy.intercept("GET", "/api/v1/erm/agreements*", {

View File

@ -23,8 +23,8 @@ function get_package() {
describe("Dialog operations", () => {
before(() => {
cy.fetch_initial_ERM_sys_pref_value();
cy.set_ERM_sys_pref_value(true);
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}');
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}');
});
beforeEach(() => {
@ -32,10 +32,6 @@ describe("Dialog operations", () => {
cy.title().should("eq", "Koha staff interface");
});
after(() => {
cy.reset_initial_ERM_sys_pref_value();
});
it("There are no ... defined", () => {
// GET packages returns empty list
cy.intercept("GET", "/api/v1/erm/eholdings/local/packages*", {

View File

@ -34,8 +34,8 @@ function get_license() {
describe("License CRUD operations", () => {
before(() => {
cy.fetch_initial_ERM_sys_pref_value();
cy.set_ERM_sys_pref_value(true);
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}');
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}');
});
beforeEach(() => {
@ -43,10 +43,6 @@ describe("License CRUD operations", () => {
cy.title().should("eq", "Koha staff interface");
});
after(() => {
cy.reset_initial_ERM_sys_pref_value();
});
it("List license", () => {
// GET license returns 500
cy.intercept("GET", "/api/v1/erm/licenses*", {

View File

@ -25,8 +25,8 @@ function get_package() {
describe("Package CRUD operations", () => {
before(() => {
cy.fetch_initial_ERM_sys_pref_value();
cy.set_ERM_sys_pref_value(true);
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}');
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}');
});
beforeEach(() => {
@ -34,10 +34,6 @@ describe("Package CRUD operations", () => {
cy.title().should("eq", "Koha staff interface");
});
after(() => {
cy.reset_initial_ERM_sys_pref_value();
});
it("List package", () => {
// GET package returns 500
cy.intercept("GET", "/api/v1/erm/eholdings/local/packages*", {

View File

@ -19,8 +19,8 @@ function get_packages_to_relate() {
describe("Title CRUD operations", () => {
before(() => {
cy.fetch_initial_ERM_sys_pref_value();
cy.set_ERM_sys_pref_value(true);
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMModule", '{"value":"1"}');
cy.intercept("GET", "/cgi-bin/koha/svc/config/systempreferences/?pref=ERMProviders", '{"value":"local"}');
});
beforeEach(() => {
@ -28,10 +28,6 @@ describe("Title CRUD operations", () => {
cy.title().should("eq", "Koha staff interface");
});
after(() => {
cy.reset_initial_ERM_sys_pref_value();
});
it("Import titles", () => {
let erm_title = cy.get_title();
let resource = erm_title.resources[0];