DEV: attempts to make deleted spec not flakey (#21695)

It easier to check for presence in this case that to check for something not present, as depending on performance of the machine running the test this could take sometime to be changed and the test would fail.
This commit is contained in:
Joffrey JAFFEUX
2023-05-23 17:13:12 +02:00
committed by GitHub
parent b637249169
commit 2a7dae51fa
2 changed files with 4 additions and 2 deletions

View File

@ -62,7 +62,7 @@
<div
class={{concat-class
"chat-message"
(if @message.staged "chat-message-staged")
(if @message.staged "chat-message-staged" "chat-message-persisted")
(if @message.deletedAt "deleted")
(if (and @message.inReplyTo (not this.hideReplyToInfo)) "is-reply")
(if this.showThreadIndicator "is-threaded")

View File

@ -17,7 +17,9 @@ RSpec.describe "Deleted message", type: :system, js: true do
it "shows as deleted" do
chat_page.visit_channel(channel_1)
channel_page.send_message("aaaaaaaaaaaaaaaaaaaa")
expect(page).to have_no_css(".chat-message-staged")
expect(page).to have_css(".chat-message-persisted")
last_message = find(".chat-message-container:last-child")
channel_page.delete_message(OpenStruct.new(id: last_message["data-id"]))