Bugzilla – Attachment 175008 Details for
Bug 38461
Table features needs to be covered by e2e tests using Cypress
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38461: Refactoring - build_libraries
Bug-38461-Refactoring---buildlibraries.patch (text/plain), 5.70 KB, created by
Jonathan Druart
on 2024-11-27 15:24:21 UTC
(
hide
)
Description:
Bug 38461: Refactoring - build_libraries
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2024-11-27 15:24:21 UTC
Size:
5.70 KB
patch
obsolete
>From 1982af0ce69467e9e61c723ab50cb3a9e26b55b9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 21 Nov 2024 16:42:34 +0100 >Subject: [PATCH] Bug 38461: Refactoring - build_libraries > >--- > t/cypress/integration/KohaTable_spec.ts | 99 +++++++------------------ > 1 file changed, 26 insertions(+), 73 deletions(-) > >diff --git a/t/cypress/integration/KohaTable_spec.ts b/t/cypress/integration/KohaTable_spec.ts >index a9d01a28573..71bfdafffe4 100644 >--- a/t/cypress/integration/KohaTable_spec.ts >+++ b/t/cypress/integration/KohaTable_spec.ts >@@ -1,5 +1,26 @@ > import { mount } from "@cypress/vue"; > >+const RESTdefaultPageSize = "20"; // FIXME Mock this >+const baseTotalCount = "42"; >+ >+function build_libraries() { >+ return cy >+ .task("buildSampleObjects", { >+ object: "library", >+ count: RESTdefaultPageSize, >+ values: { library_hours: [] }, >+ }) >+ .then(libraries => { >+ cy.intercept("GET", "/api/v1/libraries*", { >+ statusCode: 200, >+ body: libraries, >+ headers: { >+ "X-Base-Total-Count": baseTotalCount, >+ "X-Total-Count": baseTotalCount, >+ }, >+ }); >+ }); >+} > describe("kohaTable (using REST API)", () => { > beforeEach(() => { > cy.login(); >@@ -11,27 +32,11 @@ describe("kohaTable (using REST API)", () => { > > afterEach(() => {}); > >- const RESTdefaultPageSize = "20"; // FIXME Mock this >- const baseTotalCount = "42"; >- > describe("Simple tables", () => { > const table_id = "libraries"; > > it("Input search bar and clear filter ", () => { >- cy.task("buildSampleObjects", { >- object: "library", >- count: RESTdefaultPageSize, >- values: { library_hours: [] }, >- }).then(libraries => { >- cy.intercept("GET", "/api/v1/libraries*", { >- statusCode: 200, >- body: libraries, >- headers: { >- "X-Base-Total-Count": baseTotalCount, >- "X-Total-Count": baseTotalCount, >- }, >- }); >- >+ build_libraries().then(() => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.get(`#${table_id}_wrapper .dt-info`).contains( >@@ -69,20 +74,7 @@ describe("kohaTable (using REST API)", () => { > }); > > it("All columns displayed", () => { >- cy.task("buildSampleObjects", { >- object: "library", >- count: RESTdefaultPageSize, >- values: { library_hours: [] }, >- }).then(libraries => { >- cy.intercept("GET", "/api/v1/libraries*", { >- statusCode: 200, >- body: libraries, >- headers: { >- "X-Base-Total-Count": baseTotalCount, >- "X-Total-Count": baseTotalCount, >- }, >- }); >- >+ build_libraries().then(() => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.window().then(win => { >@@ -98,20 +90,7 @@ describe("kohaTable (using REST API)", () => { > }); > > it("One column hidden by default", () => { >- cy.task("buildSampleObjects", { >- object: "library", >- count: RESTdefaultPageSize, >- values: { library_hours: [] }, >- }).then(libraries => { >- cy.intercept("GET", "/api/v1/libraries*", { >- statusCode: 200, >- body: libraries, >- headers: { >- "X-Base-Total-Count": baseTotalCount, >- "X-Total-Count": baseTotalCount, >- }, >- }); >- >+ build_libraries().then(() => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.window().then(win => { >@@ -134,20 +113,7 @@ describe("kohaTable (using REST API)", () => { > }); > > it("One column hidden by default then shown by user - Save state OFF", () => { >- cy.task("buildSampleObjects", { >- object: "library", >- count: RESTdefaultPageSize, >- values: { library_hours: [] }, >- }).then(libraries => { >- cy.intercept("GET", "/api/v1/libraries*", { >- statusCode: 200, >- body: libraries, >- headers: { >- "X-Base-Total-Count": baseTotalCount, >- "X-Total-Count": baseTotalCount, >- }, >- }); >- >+ build_libraries().then(() => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.window().then(win => { >@@ -201,20 +167,7 @@ describe("kohaTable (using REST API)", () => { > }); > > it("One column hidden by default then shown by user - Save state is ON", () => { >- cy.task("buildSampleObjects", { >- object: "library", >- count: RESTdefaultPageSize, >- values: { library_hours: [] }, >- }).then(libraries => { >- cy.intercept("GET", "/api/v1/libraries*", { >- statusCode: 200, >- body: libraries, >- headers: { >- "X-Base-Total-Count": baseTotalCount, >- "X-Total-Count": baseTotalCount, >- }, >- }); >- >+ build_libraries().then(() => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.window().then(win => { >-- >2.34.1
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 38461
:
174877
|
174878
|
175004
|
175005
|
175006
|
175007
|
175008
|
175009
|
175010
|
175011
|
175015
|
175016
|
175179
|
175223
|
175224
|
175225
|
175226
|
175227
|
175228
|
175229
|
175230
|
175231
|
175232
|
175233
|
175234
|
175235
|
175289
|
175290
|
175291
|
175292
|
176082
|
176083
|
176084
|
176085
|
176086
|
176087
|
176088
|
176089
|
176090
|
176091
|
176092
|
176093
|
176793
|
176846
|
176902