DEV: Partially revert d1924c7328 (#21895)

Just remove the assertions for now as they are a constant source of
tests flakiness.
This commit is contained in:
Alan Guo Xiang Tan 2023-06-02 07:35:42 +09:00 committed by GitHub
parent 0330f51d75
commit 876734bcb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 17 deletions

View File

@ -37,10 +37,7 @@ RSpec.describe "Chat message onebox", type: :system, js: true do
it "is oneboxed" do
chat_page.visit_channel(channel_1)
channel_page.send_message(
"https://en.wikipedia.org/wiki/Hyperlink",
check_message_presence: false,
)
channel_page.send_message("https://en.wikipedia.org/wiki/Hyperlink")
expect(page).to have_content("This is a test", wait: 20)
end

View File

@ -39,11 +39,7 @@ RSpec.describe "Edited message", type: :system, js: true do
message_1 = Fabricate(:chat_message, chat_channel: channel_1, user: current_user)
chat_page.visit_channel(channel_1)
channel_page.edit_message(
message_1,
'[date=2025-03-10 timezone="Europe/Paris"]',
check_message_presence: false,
)
channel_page.edit_message(message_1, '[date=2025-03-10 timezone="Europe/Paris"]')
expect(page).to have_css(".cooked-date")
end

View File

@ -16,7 +16,7 @@ RSpec.describe "Message errors", type: :system, js: true do
sign_in(current_user)
chat_page.visit_channel(channel)
channel_page.send_message("atoolongmessage" + "a" * max_length, check_message_presence: false)
channel_page.send_message("atoolongmessage" + "a" * max_length)
expect(page).to have_no_content("atoolongmessage")
expect(page).to have_content(I18n.t("chat.errors.message_too_long", count: max_length))

View File

@ -120,19 +120,17 @@ module PageObjects
find("[data-value='edit']").click
end
def edit_message(message, text = nil, check_message_presence: true)
def edit_message(message, text = nil)
open_edit_message(message)
send_message(text, check_message_presence:) if text
send_message(text) if text
end
def send_message(text = nil, check_message_presence: true)
def send_message(text = nil)
text ||= Faker::Lorem.characters(number: SiteSetting.chat_minimum_message_length)
text = text.chomp if text.present? # having \n on the end of the string counts as an Enter keypress
composer.fill_in(with: text)
click_send_message
expect(messages).to have_message(text: text, persisted: true) if check_message_presence
click_composer
expect(self).to have_no_loading_skeleton
text
end

View File

@ -62,7 +62,6 @@ module PageObjects
text = text.chomp if text.present? # having \n on the end of the string counts as an Enter keypress
composer.fill_in(with: text)
click_send_message
expect(messages).to have_message(text: text, persisted: true)
click_composer
text
end

View File

@ -141,7 +141,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do
clip_text = copy_messages_to_clipboard(message_1)
click_selection_button("cancel")
chat_channel_page.send_message(clip_text, check_message_presence: false)
chat_channel_page.send_message(clip_text)
expect(page).to have_selector(".chat-message", count: 2)
expect(page).to have_css(".chat-transcript")