FIX: ensures staged message are set with channel id (#20335)

This commit is contained in:
Joffrey JAFFEUX 2023-02-16 18:05:13 +01:00 committed by GitHub
parent 479c0a3051
commit eb0caed75a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 9 deletions

View File

@ -774,6 +774,7 @@ export default Component.extend({
staged_id: null,
excerpt: data.chat_message.excerpt,
thread_id: data.chat_message.thread_id,
chat_channel_id: data.chat_message.chat_channel_id,
});
const inReplyToMsg =

View File

@ -6,7 +6,6 @@ RSpec.describe "Deleted message", type: :system, js: true do
fab!(:current_user) { Fabricate(:user) }
fab!(:channel_1) { Fabricate(:category_channel) }
fab!(:message_1) { Fabricate(:chat_message, chat_channel: channel_1, user: current_user) }
before do
chat_system_bootstrap
@ -18,9 +17,10 @@ RSpec.describe "Deleted message", type: :system, js: true do
it "shows as deleted" do
chat_page.visit_channel(channel_1)
expect(channel_page).to have_no_loading_skeleton
channel_page.expand_message_actions(message_1)
find("[data-value='deleteMessage']").click
channel_page.send_message("aaaaaaaaaaaaaaaaaaaa")
expect(page).to have_no_css("[data-staged-id]")
last_message = find(".chat-message-container:last-child")
channel_page.delete_message(OpenStruct.new(id: last_message["data-id"]))
expect(page).to have_content(I18n.t("js.chat.deleted"))
end

View File

@ -31,7 +31,7 @@ module PageObjects
def expand_message_actions(message)
hover_message(message)
click_more_buttons(message)
click_more_button
end
def expand_message_actions_mobile(message, delay: 2)
@ -56,13 +56,19 @@ module PageObjects
find(".bookmark-btn").click
end
def click_more_buttons(message)
def click_more_button
find(".more-buttons").click
end
def flag_message(message)
hover_message(message)
click_more_buttons(message)
click_more_button
find("[data-value='flag']").click
end
def flag_message(message)
hover_message(message)
click_more_button
find("[data-value='flag']").click
end
@ -73,13 +79,19 @@ module PageObjects
def select_message(message)
hover_message(message)
click_more_buttons(message)
click_more_button
find("[data-value='selectMessage']").click
end
def delete_message(message)
hover_message(message)
click_more_button
find("[data-value='deleteMessage']").click
end
def open_edit_message(message)
hover_message(message)
click_more_buttons(message)
click_more_button
find("[data-value='edit']").click
end