Skip to content
Snippets Groups Projects
Unverified Commit f2003515 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

#17738 Repro: "Native query editing" permission selector is inconsistent...

#17738 Repro: "Native query editing" permission selector is inconsistent between "No self service" and "Block" permissions (#17742)

* Add repro for #17738

* Update repro according to the product requirements
parent e0ded3a9
No related branches found
No related tags found
No related merge requests found
......@@ -509,6 +509,27 @@ describe("scenarios > admin > permissions", () => {
cy.findAllByText("Orders").should("not.exist");
});
it.skip("'block' data permission should not have editable 'native query editing' option (metabase#17738)", () => {
cy.visit("/admin/permissions/data/database/1");
cy.findByText("All Users")
.closest("tr")
.as("allUsersRow")
.within(() => {
isPermissionDisabled("No", true);
isPermissionDisabled("No self-service", false).click();
});
popover()
.contains("Block")
.click();
cy.get("@allUsersRow").within(() => {
isPermissionDisabled("Block", false);
isPermissionDisabled("No", true);
});
});
});
describeWithToken("scenarios > admin > permissions", () => {
......@@ -633,3 +654,17 @@ function assertPermissionTable(rows) {
});
});
}
/**
* @param {string} permission
* @param {boolean} isDisabled
*/
function isPermissionDisabled(permission, isDisabled) {
return (
cy
.findByText(permission)
.closest("a")
// This assertion works only with strings "true" | "false", and not with booleans.
.should("have.attr", "aria-disabled", "" + isDisabled)
);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment