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

Expand "pin collection items" test (#15303)

Expands "pin collection item" workflow to include in a following manner:

- Pins both dashboard and a question
- Asserts that only the dashboard is visible on the home page (according to the documentation in https://www.metabase.com/docs/latest/users-guide/06-sharing-answers.html)
parent e1b2868e
No related branches found
No related tags found
No related merge requests found
......@@ -189,23 +189,32 @@ describe("scenarios > collection_defaults", () => {
cy.findByText("Orders");
});
it("should allow a user to pin an item", () => {
it("pinning an item workflow should work", () => {
cy.visit("/collection/root");
// Assert that we're starting from a scenario with no pins
cy.findByText("Pinned items").should("not.exist");
// 1. Click on the ... menu
openEllipsisMenuFor("Orders in a dashboard");
// 2. Select "pin this" from the popover
cy.findByText("Pin this item").click();
pinItem("Orders in a dashboard"); // dashboard
pinItem("Orders, Count"); // question
// 3. Should see "pinned items" and the item should be in that section
// Should see "pinned items" and items should be in that section
cy.findByText("Pinned items")
.parent()
.contains("Orders in a dashboard");
// 4. Consequently, "Everything else" should now also be visible
.within(() => {
cy.findByText("Orders in a dashboard");
cy.findByText("Orders, Count");
});
// Consequently, "Everything else" should now also be visible
cy.findByText("Everything else");
// Only pinned dashboards should show up on the home page...
cy.visit("/");
cy.findByText("Orders in a dashboard");
cy.findByText("Orders, Count").should("not.exist");
// ...but not for the user without permissions to see the root collection
cy.signOut();
cy.signIn("none");
cy.visit("/");
cy.findByText("Orders in a dashboard").should("not.exist");
});
it.skip("should let a user select all items using checkbox (metabase#14705)", () => {
......@@ -576,3 +585,8 @@ function openEllipsisMenuFor(item) {
.find(".Icon-ellipsis")
.click({ force: true });
}
function pinItem(item) {
openEllipsisMenuFor(item);
cy.findByText("Pin this item").click();
}
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