Bug 41604: Add one more Cypress test
Signed-off-by: Jason Robb <jrobb@sekls.org> Signed-off-by: Victor Grousset/tuxayo <victor@tuxayo.net> Signed-off-by: Lucas Gass <lucas@bywatersolutions.com>
This commit is contained in:
parent
7db7879ccc
commit
316b1477af
|
|
@ -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");
|
||||
|
|
|
|||
Loading…
Reference in New Issue