DEV: fix flaky chat new message spec (#30731)

Ensures that visiting the route creates a new chat channel before
checking the new redirected url is using the last channel.
This commit is contained in:
David Battersby 2025-01-13 13:01:08 +04:00 committed by GitHub
parent 7c96d7587e
commit 0b3663a16a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -28,6 +28,7 @@ RSpec.describe "Chat New Message from params", type: :system do
it "creates a dm channel and redirects if none exists" do
chat_page.visit_new_message(user_2)
expect(page).to have_css(".chat-channel-name__label", text: user_2.username)
expect(page).to have_current_path("/chat/c/#{user_2.username}/#{Chat::Channel.last.id}")
end