Bugzilla – Attachment 149205 Details for
Bug 33408
Fetch sysprefs from svc/config/systempreferences
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 33408: Mock ERM sysprefs from cypress tests
Bug-33408-Mock-ERM-sysprefs-from-cypress-tests.patch (text/plain), 5.78 KB, created by
Pedro Amorim
on 2023-04-05 13:04:16 UTC
(
hide
)
Description:
Bug 33408: Mock ERM sysprefs from cypress tests
Filename:
MIME Type:
Creator:
Pedro Amorim
Created:
2023-04-05 13:04:16 UTC
Size:
5.78 KB
patch
obsolete
>From 7cac62e25ded33336108ae071ceab288f544f7a1 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Tue, 4 Apr 2023 17:02:12 +0200 >Subject: [PATCH] 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> >--- > t/cypress/integration/ERM/Agreements_spec.ts | 8 ++------ > t/cypress/integration/ERM/Dialog_spec.ts | 8 ++------ > t/cypress/integration/ERM/Licenses_spec.ts | 8 ++------ > t/cypress/integration/ERM/Packages_spec.ts | 8 ++------ > t/cypress/integration/ERM/Titles_spec.ts | 8 ++------ > 5 files changed, 10 insertions(+), 30 deletions(-) > >diff --git a/t/cypress/integration/ERM/Agreements_spec.ts b/t/cypress/integration/ERM/Agreements_spec.ts >index 8dd209ee8d5..b9319278583 100644 >--- a/t/cypress/integration/ERM/Agreements_spec.ts >+++ b/t/cypress/integration/ERM/Agreements_spec.ts >@@ -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*", { >diff --git a/t/cypress/integration/ERM/Dialog_spec.ts b/t/cypress/integration/ERM/Dialog_spec.ts >index 9f39eaa2125..dc85f035d24 100644 >--- a/t/cypress/integration/ERM/Dialog_spec.ts >+++ b/t/cypress/integration/ERM/Dialog_spec.ts >@@ -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*", { >diff --git a/t/cypress/integration/ERM/Licenses_spec.ts b/t/cypress/integration/ERM/Licenses_spec.ts >index 88791518282..78d1390c029 100644 >--- a/t/cypress/integration/ERM/Licenses_spec.ts >+++ b/t/cypress/integration/ERM/Licenses_spec.ts >@@ -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*", { >diff --git a/t/cypress/integration/ERM/Packages_spec.ts b/t/cypress/integration/ERM/Packages_spec.ts >index f5f6be5c4ed..647c30d19eb 100644 >--- a/t/cypress/integration/ERM/Packages_spec.ts >+++ b/t/cypress/integration/ERM/Packages_spec.ts >@@ -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*", { >diff --git a/t/cypress/integration/ERM/Titles_spec.ts b/t/cypress/integration/ERM/Titles_spec.ts >index 90061e600db..06724aa4d8c 100644 >--- a/t/cypress/integration/ERM/Titles_spec.ts >+++ b/t/cypress/integration/ERM/Titles_spec.ts >@@ -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]; >-- >2.30.2
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 33408
:
149131
|
149132
|
149133
|
149134
|
149184
|
149185
|
149186
|
149196
|
149197
|
149198
|
149200
|
149204
|
149205
|
149206
|
149207
|
149208
|
149209
|
149254
|
149438
|
149516
|
149517
|
149518
|
149535
|
149536
|
149537
|
149538
|
149539
|
149540
|
149541
|
149542
|
149543
|
149570