From 316b1477af60cd37a1558e0e4a683dfedfb38f9e Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 15 Jun 2026 16:49:16 +0200 Subject: [PATCH] Bug 41604: Add one more Cypress test Signed-off-by: Jason Robb Signed-off-by: Victor Grousset/tuxayo Signed-off-by: Lucas Gass --- .../integration/KohaTable/KohaTable_spec.ts | 55 +++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/t/cypress/integration/KohaTable/KohaTable_spec.ts b/t/cypress/integration/KohaTable/KohaTable_spec.ts index f766fc3a69..16277ea215 100644 --- a/t/cypress/integration/KohaTable/KohaTable_spec.ts +++ b/t/cypress/integration/KohaTable/KohaTable_spec.ts @@ -332,6 +332,61 @@ describe("kohaTable (using REST API)", () => { }); }); + it("visibility_condition modified, cannot_be_toggled", () => { + build_libraries().then(() => { + cy.visit("/cgi-bin/koha/admin/branches.pl"); + + // default settings: hide "Code" + cy.mock_table_settings({ + default_save_state: 1, + columns: { + library_code: { + visibility_condition: false, + is_hidden: false, + cannot_be_toggled: true, + }, + }, + }); + + cy.get("@columns").then(columns => { + cy.get(`#${table_id} th`).should( + "have.length", + columns.length - 1 + ); + cy.get(`#${table_id} th`).contains("Name"); + cy.get(`#${table_id} th`) + .contains("Code") + .should("not.exist"); + }); + + // Do not touch anything + // But turn on a syspref that would display the column + // Should be kept hidden after reload + // This is the behaviour for the Export column of the checkouts table, and syspref ExportCircHistory + cy.mock_table_settings({ + default_save_state: 1, + columns: { + library_code: { + visibility_condition: true, + is_hidden: false, + cannot_be_toggled: true, + }, + }, + }); + + cy.visit("/cgi-bin/koha/admin/branches.pl"); + + cy.get("@columns").then(columns => { + cy.get(`#${table_id} th`).should( + "have.length", + columns.length - 1 + ); + cy.get(`#${table_id} th`).contains("Name"); + cy.get(`#${table_id} th`).contains("Code"); + }); + }); + }); + it("Shareable link", { scrollBehavior: false }, () => { build_libraries().then(() => { cy.visit("/cgi-bin/koha/admin/branches.pl");