From 4e1d40609490b10bb42b5fdf6bef37aa99cc0713 Mon Sep 17 00:00:00 2001
From: Nemanja Glumac <31325167+nemanjaglumac@users.noreply.github.com>
Date: Thu, 17 Feb 2022 14:31:50 +0100
Subject: [PATCH] Repro #20551: Filter dropdown only allows filtering on
 "starts with" (#20581)

---
 .../20551-filter-starts-with.cy.spec.js       | 26 +++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 frontend/test/metabase/scenarios/question/reproductions/20551-filter-starts-with.cy.spec.js

diff --git a/frontend/test/metabase/scenarios/question/reproductions/20551-filter-starts-with.cy.spec.js b/frontend/test/metabase/scenarios/question/reproductions/20551-filter-starts-with.cy.spec.js
new file mode 100644
index 00000000000..f219a0716ed
--- /dev/null
+++ b/frontend/test/metabase/scenarios/question/reproductions/20551-filter-starts-with.cy.spec.js
@@ -0,0 +1,26 @@
+import { restore, openProductsTable, filter } from "__support__/e2e/cypress";
+
+describe("issue 20551", () => {
+  beforeEach(() => {
+    restore();
+    cy.signInAsAdmin();
+  });
+
+  it("should allow filtering with includes, rather than starts with (metabase#20551)", () => {
+    openProductsTable({ mode: "notebook" });
+    filter({ mode: "notebook" });
+    cy.findByText("Category").click();
+
+    // Make sure input field is auto-focused
+    cy.focused()
+      .should("have.attr", "placeholder", "Search the list")
+      .type("i");
+
+    // All categories that contain `i`
+    cy.findByText("Doohickey");
+    cy.findByText("Gizmo");
+    cy.findByText("Widget");
+
+    cy.findByText("Gadget").should("not.exist");
+  });
+});
-- 
GitLab