Fix flaky test in show_user_count_threshold_spec.rb
requested to merge 329303-flaky-test-ee-spec-features-admin-licenses-show_user_count_threshold_spec-rb-1-1-1-1-2-1-1 into master
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