Bugzilla – Attachment 176085 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: Save state ON/OFF
Bug-38461-Save-state-ONOFF.patch (text/plain), 4.91 KB, created by
Martin Renvoize (ashimema)
on 2025-01-02 16:18:47 UTC
(
hide
)
Description:
Bug 38461: Save state ON/OFF
Filename:
MIME Type:
Creator:
Martin Renvoize (ashimema)
Created:
2025-01-02 16:18:47 UTC
Size:
4.91 KB
patch
obsolete
>From ed3c6fa9ca91acca7dbec81b1e67ca534990dfb9 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Thu, 21 Nov 2024 16:40:08 +0100 >Subject: [PATCH] Bug 38461: Save state ON/OFF > >Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> >Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> >--- > t/cypress/integration/KohaTable_spec.ts | 72 ++++++++++++++++++++++++- > 1 file changed, 70 insertions(+), 2 deletions(-) > >diff --git a/t/cypress/integration/KohaTable_spec.ts b/t/cypress/integration/KohaTable_spec.ts >index a1bb6b94996..a9d01a28573 100644 >--- a/t/cypress/integration/KohaTable_spec.ts >+++ b/t/cypress/integration/KohaTable_spec.ts >@@ -133,8 +133,7 @@ describe("kohaTable (using REST API)", () => { > }); > }); > >- /* TODO Missing mock, we assume that 'Save state' is ON */ >- it("One column hidden by default then shown by user", () => { >+ it("One column hidden by default then shown by user - Save state OFF", () => { > cy.task("buildSampleObjects", { > object: "library", > count: RESTdefaultPageSize, >@@ -152,6 +151,7 @@ describe("kohaTable (using REST API)", () => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.window().then(win => { >+ win.table_settings.default_save_state = 0; > win.table_settings.columns = win.table_settings.columns.map( > c => ({ ...c, is_hidden: 0, cannot_be_toggled: 0 }) > ); >@@ -181,6 +181,74 @@ describe("kohaTable (using REST API)", () => { > cy.visit("/cgi-bin/koha/admin/branches.pl"); > > cy.window().then(win => { >+ win.table_settings.default_save_state = 0; >+ win.table_settings.columns = win.table_settings.columns.map( >+ c => ({ ...c, is_hidden: 0, cannot_be_toggled: 0 }) >+ ); >+ win.table_settings.columns.find( >+ c => c.columnname == "library_code" >+ ).is_hidden = 1; >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ win.table_settings.columns.length >+ ); >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`) >+ .contains("Code") >+ .should("not.exist"); >+ }); >+ }); >+ }); >+ >+ 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, >+ }, >+ }); >+ >+ cy.visit("/cgi-bin/koha/admin/branches.pl"); >+ >+ cy.window().then(win => { >+ win.table_settings.default_save_state = 1; >+ win.table_settings.columns = win.table_settings.columns.map( >+ c => ({ ...c, is_hidden: 0, cannot_be_toggled: 0 }) >+ ); >+ win.table_settings.columns.find( >+ c => c.columnname == "library_code" >+ ).is_hidden = 1; >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ win.table_settings.columns.length - 1 >+ ); >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`) >+ .contains("Code") >+ .should("not.exist"); >+ cy.get(`#${table_id}_wrapper .buttons-colvis`).click(); >+ cy.get(`#${table_id}_wrapper .dt-button-collection`) >+ .contains("Code") >+ .click(); >+ cy.get(`#${table_id} th`).should( >+ "have.length", >+ win.table_settings.columns.length >+ ); >+ cy.get(`#${table_id} th`).contains("Name"); >+ cy.get(`#${table_id} th`).contains("Code"); >+ }); >+ >+ cy.visit("/cgi-bin/koha/admin/branches.pl"); >+ >+ cy.window().then(win => { >+ win.table_settings.default_save_state = 1; > win.table_settings.columns = win.table_settings.columns.map( > c => ({ ...c, is_hidden: 0, cannot_be_toggled: 0 }) > ); >-- >2.47.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