DEV: Update checks in chat channel and thread page objects (#21889)

What is the problem?

We were calling out to methods that calls `has_css?` or `has_selector?`
which returns a boolean. Since we are not using the return value, it
means the methods can be deemed unnecessary. However, we do want those
checks and this commit adds the necessarily assertions to make use of
the return values.
This commit is contained in:
Alan Guo Xiang Tan
2023-06-01 23:31:01 +09:00
committed by GitHub
parent 0d0ca075a6
commit d1924c7328
7 changed files with 23 additions and 11 deletions

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)
channel_page.send_message("atoolongmessage" + "a" * max_length, check_message_presence: false)
expect(page).to have_no_content("atoolongmessage")
expect(page).to have_content(I18n.t("chat.errors.message_too_long", count: max_length))