From b37d335d6f6cac73bbe4190000d4602280332329 Mon Sep 17 00:00:00 2001
From: Tom Robinson <tlrobinson@gmail.com>
Date: Mon, 8 Apr 2019 12:36:13 -0700
Subject: [PATCH] Fix occasional CI failure on parameters.e2e.spec.js

---
 .../parameters/parameters.e2e.spec.js         | 37 ++++++++++---------
 1 file changed, 20 insertions(+), 17 deletions(-)

diff --git a/frontend/test/metabase/parameters/parameters.e2e.spec.js b/frontend/test/metabase/parameters/parameters.e2e.spec.js
index 9486cab05bc..5d64529b56e 100644
--- a/frontend/test/metabase/parameters/parameters.e2e.spec.js
+++ b/frontend/test/metabase/parameters/parameters.e2e.spec.js
@@ -11,6 +11,7 @@ import {
   waitForRequestToComplete,
   waitForAllRequestsToComplete,
   cleanup,
+  eventually,
 } from "__support__/e2e_tests";
 
 import jwt from "jsonwebtoken";
@@ -439,23 +440,25 @@ async function sharedParametersTests(getAppAndStore) {
   //   ]);
   // });
 
-  it("should have the correct values", () => {
-    const widgets = app.find(FieldValuesWidget);
-    const values = widgets.map(
-      widget =>
-        widget
-          .find("ul") // first ul is options
-          .at(0)
-          .find("li")
-          .map(li => li.text())
-          .slice(0, -1), // the last item is the input, remove it
-    );
-    expect(values).toEqual([
-      ["Hudson Borer - 1"], // remapped value
-      [],
-      [],
-      [],
-    ]);
+  it("should have the correct values", async () => {
+    await eventually(() => {
+      const widgets = app.find(FieldValuesWidget);
+      const values = widgets.map(
+        widget =>
+          widget
+            .find("ul") // first ul is options
+            .at(0)
+            .find("li")
+            .map(li => li.text())
+            .slice(0, -1), // the last item is the input, remove it
+      );
+      expect(values).toEqual([
+        ["Hudson Borer - 1"], // remapped value
+        [],
+        [],
+        [],
+      ])
+    });
   });
 
   it("should have the correct placeholders", () => {
-- 
GitLab