From 334a629959d5138613f2ff364ae1ae6d43cbe379 Mon Sep 17 00:00:00 2001 From: Dominik Klein Date: Mon, 14 Feb 2022 15:33:12 +0100 Subject: [PATCH] Maintenance: Try to make the maintenance login message test more robust. --- spec/system/login/message_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/system/login/message_spec.rb b/spec/system/login/message_spec.rb index f01ec62e0..5694c1c0a 100644 --- a/spec/system/login/message_spec.rb +++ b/spec/system/login/message_spec.rb @@ -62,5 +62,15 @@ RSpec.describe 'Login Message', type: :system, authenticated_as: false do visit '/' ensure_websocket + + # Wait until the event binding for the 'config_update_local' is present. + # TODO: If this works we can maybe move the check for event bindings in a helper function. + wait.until do + page.evaluate_script("Object.keys(App.Event._allBindings()).find((key) => { + return App.Event._allBindings()[key].find((item) => { + return item.event === 'config_update_local'; + }); + })") + end end end