DEV: rely on default session in smoke spec (#26054)

This commit is contained in:
Joffrey JAFFEUX 2024-03-06 14:08:06 +01:00 committed by GitHub
parent d1a2596889
commit 65c6909419
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 9 additions and 16 deletions

View File

@ -20,11 +20,9 @@ RSpec.describe "Reply to message - smoke", type: :system do
context "when two users create a thread on the same message" do
it "works" do
using_session(:user_1) do
sign_in(user_1)
chat_page.visit_channel(channel_1)
channel_page.reply_to(original_message)
end
sign_in(user_1)
chat_page.visit_channel(channel_1)
channel_page.reply_to(original_message)
using_session(:user_2) do
sign_in(user_2)
@ -33,12 +31,9 @@ RSpec.describe "Reply to message - smoke", type: :system do
expect(side_panel).to have_open_thread(original_message.thread)
end
using_session(:user_1) do
thread_page.send_message("user1reply")
expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(1)
expect(thread_page.messages).to have_message(text: "user1reply")
end
thread_page.send_message("user1reply")
expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(1)
expect(thread_page.messages).to have_message(text: "user1reply")
using_session(:user_2) do |session|
expect(thread_page.messages).to have_message(text: "user1reply")
@ -53,11 +48,9 @@ RSpec.describe "Reply to message - smoke", type: :system do
session.quit
end
using_session(:user_1) do
expect(thread_page.messages).to have_message(text: "user1reply")
expect(thread_page.messages).to have_message(text: "user2reply")
expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(3)
end
expect(thread_page.messages).to have_message(text: "user1reply")
expect(thread_page.messages).to have_message(text: "user2reply")
expect(channel_page.message_thread_indicator(original_message)).to have_reply_count(3)
end
end
end