The personal finance app for everyone (by everyone)
Ruby
fix: resolve flaky chats system test race condition (#1375)
Serge L7f3b12107be3
diff --git a/test/system/chats_test.rb b/test/system/chats_test.rbindex ff4a42f987..3796211078 100644--- a/test/system/chats_test.rb+++ b/test/system/chats_test.rb@@ -32,17 +32,23 @@ class ChatsTest < ApplicationSystemTestCasetest "sidebar shows last viewed chat" dowith_env_overrides OPENAI_ACCESS_TOKEN: "test-token" do@user.update!(ai_enabled: true)+ chat_title = @user.chats.first.titlevisit root_url- click_on @user.chats.first.title+ click_on chat_title++ # Wait for the chat to actually load before refreshing+ within "#chat-container" do+ assert_selector "h1", text: chat_title+ end# Page refreshvisit root_url# After page refresh, we're still on the last chat we were viewingwithin "#chat-container" do- assert_selector "h1", text: @user.chats.first.title+ assert_selector "h1", text: chat_titleendendend