Skip to content

Fix flaky test in show_user_count_threshold_spec.rb

What does this MR do?

Wait until JS has loaded before clicking the close button.

We add .page-initialised at the end of deferredInitialisation, which is where the userCallbacks are set up

Better way is to disable the inactive button in haml then enable in JS but that has some other UI considerations (such as we'd want disabled tooltip while loading)

Explanation in #329303 (comment 568461745)

Related to #329303 (closed)

To replicate flaky spec, make the following local changes:

diff --git a/app/assets/javascripts/main.js b/app/assets/javascripts/main.js
index 3f22bd36a4a..e97b6e13d3c 100644
--- a/app/assets/javascripts/main.js
+++ b/app/assets/javascripts/main.js
@@ -87,7 +87,9 @@ function deferredInitialisation() {
   initUserPopovers();
   initBroadcastNotifications();
   initFrequentItemDropdowns();
-  initPersistentUserCallouts();
+  setTimeout(() => {
+    initPersistentUserCallouts();
+  }, 1000);
   initDefaultTrackers();
   initFeatureHighlight();
Edited by Simon Knox

Merge request reports