Skip to content

A platform for community discussion. Free, open, simple.

DEV: Fix a admin_customize_themes spec flake (#39809)

Jarek Radoszf2d8a4e894bf
diff --git a/spec/system/admin_customize_themes_spec.rb b/spec/system/admin_customize_themes_spec.rb
index fd73dc2c9f6..d91ba7ed3c0 100644
--- a/spec/system/admin_customize_themes_spec.rb
+++ b/spec/system/admin_customize_themes_spec.rb
@@ -382,6 +382,15 @@ describe "Admin Customize Themes" do
visit("/")
expect(banner).to be_visible
+ # Wait for the `/client_settings` subscription's first poll finish.
+ try_until_success do
+ expect(
+ page.evaluate_script(
+ "window.MessageBus.callbacks.find(c => c.channel === '/client_settings')?.last_id",
+ ),
+ ).not_to eq(-1)
+ end
+
using_session(:admin) do
sign_in(admin)
theme_page.visit(theme.id)