From 3d1ee1c61972f037cbbe535224c124cc658a8d59 Mon Sep 17 00:00:00 2001
From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Date: Sun, 28 Mar 2021 15:39:28 +0200
Subject: [PATCH] #15338 Repro: Not possible to select pinned collection item
 using checkbox (#15348)

---
 .../collections/collections.cy.spec.js        | 32 +++++++++++++------
 1 file changed, 22 insertions(+), 10 deletions(-)

diff --git a/frontend/test/metabase/scenarios/collections/collections.cy.spec.js b/frontend/test/metabase/scenarios/collections/collections.cy.spec.js
index 75218469deb..4ffe96ebfbd 100644
--- a/frontend/test/metabase/scenarios/collections/collections.cy.spec.js
+++ b/frontend/test/metabase/scenarios/collections/collections.cy.spec.js
@@ -477,22 +477,23 @@ describe("scenarios > collection_defaults", () => {
       cy.findByText("First Collection");
     });
 
-    it.skip("should let a user select all items using checkbox (metabase#14705)", () => {
+    it.skip("should let be possible to select all items using checkbox (metabase#14705)", () => {
       cy.visit("/collection/root");
-      cy.findByText("Orders")
-        .closest("a")
-        .within(() => {
-          cy.icon("table").trigger("mouseover");
-          cy.findByRole("checkbox")
-            .should("be.visible")
-            .click();
-        });
-
+      selectItemUsingCheckbox("Orders");
       cy.findByText("1 item selected").should("be.visible");
       cy.icon("dash").click();
       cy.icon("dash").should("not.exist");
       cy.findByText("4 items selected");
     });
+
+    it.skip("should be possible to select pinned item using checkbox (metabase#15338)", () => {
+      cy.visit("/collection/root");
+      openEllipsisMenuFor("Orders");
+      cy.findByText("Pin this item").click();
+      cy.findByText(/Pinned items/i);
+      selectItemUsingCheckbox("Orders");
+      cy.findByText("1 item selected");
+    });
   });
 });
 
@@ -528,3 +529,14 @@ function openEllipsisMenuFor(item) {
     .find(".Icon-ellipsis")
     .click({ force: true });
 }
+
+function selectItemUsingCheckbox(item, icon = "table") {
+  cy.findByText(item)
+    .closest("a")
+    .within(() => {
+      cy.icon(icon).trigger("mouseover");
+      cy.findByRole("checkbox")
+        .should("be.visible")
+        .click();
+    });
+}
-- 
GitLab