FIX: attempt to fix multi sessions reaction spec (#22797)
I was only able to get one failure out of 100 tries, this failure didn't get me more info. My best guess ATM is that sometimes, the first session was still loading while receiving the reaction and created some unexpected situation. The commit attempts to start the "check" session before the session making the reaction hoping that will be enough to prevent this case, if this is the issue.
This commit is contained in:
parent
62d3979870
commit
5346e7f693
|
@ -71,26 +71,27 @@ RSpec.describe "React to message", type: :system do
|
||||||
|
|
||||||
context "when current user has multiple sessions" do
|
context "when current user has multiple sessions" do
|
||||||
it "adds reaction on each session" do
|
it "adds reaction on each session" do
|
||||||
reaction = OpenStruct.new(emoji: "grimacing")
|
reaction = "grimacing"
|
||||||
|
|
||||||
|
sign_in(current_user)
|
||||||
|
chat.visit_channel(category_channel_1)
|
||||||
|
|
||||||
using_session(:tab_1) do
|
using_session(:tab_1) do
|
||||||
sign_in(current_user)
|
sign_in(current_user)
|
||||||
chat.visit_channel(category_channel_1)
|
chat.visit_channel(category_channel_1)
|
||||||
end
|
end
|
||||||
|
|
||||||
sign_in(current_user)
|
|
||||||
chat.visit_channel(category_channel_1)
|
|
||||||
|
|
||||||
using_session(:tab_1) do |session|
|
using_session(:tab_1) do |session|
|
||||||
channel.hover_message(message_1)
|
channel.hover_message(message_1)
|
||||||
find(".chat-message-react-btn").click
|
find(".chat-message-react-btn").click
|
||||||
find(".chat-emoji-picker [data-emoji=\"#{reaction.emoji}\"]").click
|
find(".chat-emoji-picker [data-emoji=\"#{reaction}\"]").click
|
||||||
|
|
||||||
|
expect(channel).to have_reaction(message_1, reaction)
|
||||||
|
|
||||||
expect(channel).to have_reaction(message_1, reaction.emoji)
|
|
||||||
session.quit
|
session.quit
|
||||||
end
|
end
|
||||||
|
|
||||||
expect(channel).to have_reaction(message_1, reaction.emoji)
|
expect(channel).to have_reaction(message_1, "grimacing")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue