From 7271eb59f43ac717e12a8a37ad0a184055be120b Mon Sep 17 00:00:00 2001 From: GPT on behalf of DHH <2741+dhh@users.noreply.github.com> Date: Wed, 7 Oct 2026 21:56:09 +0200 Subject: [PATCH] Wait for persisted messages before leaving system job helpers --- test/test_helpers/system_test_helper.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/test_helpers/system_test_helper.rb b/test/test_helpers/system_test_helper.rb index 6f32eda..293ebc8 100644 --- a/test/test_helpers/system_test_helper.rb +++ b/test/test_helpers/system_test_helper.rb @@ -22,6 +22,8 @@ module SystemTestHelper def send_message(message) fill_in_rich_text_area "message_body", with: message click_on "send" + # Keep job helpers active through the actual response, not the optimistic DOM. + assert_selector ".message[data-message-id]:not([data-pending-message]) .message__body", text: message end def within_message(message, &block)