From 291701034c5a6bea36f13bbab9a7ca42874db815 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Tue, 13 Dec 2022 13:51:17 +0100 Subject: [PATCH] fix tests --- plugins/chat/spec/system/transcript_spec.rb | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/plugins/chat/spec/system/transcript_spec.rb b/plugins/chat/spec/system/transcript_spec.rb index 7960bb7146..8a3159b7b6 100644 --- a/plugins/chat/spec/system/transcript_spec.rb +++ b/plugins/chat/spec/system/transcript_spec.rb @@ -117,7 +117,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do expect(page).to have_css(".chat-transcript") end topic_page.send_reply - expect(page).to have_content("This is a new post!") + expect(page).to have_no_selector(".topic-post.staged") within topic_page.post_by_number(topic.posts.reload.last.post_number) do expect(page).to have_css(".chat-transcript") end @@ -139,7 +139,7 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do end expect(page).to have_content("Originally sent in #{chat_channel_1.name}") topic_page.send_reply - expect(page).to have_content("This is a new post!") + expect(page).to have_no_selector(".topic-post.staged") within topic_page.post_by_number(topic.posts.reload.last.post_number) do expect(page).to have_css(".chat-transcript", count: 4) end @@ -211,15 +211,10 @@ RSpec.describe "Quoting chat message transcripts", type: :system, js: true do # create the topic with the transcript as the OP topic_page.fill_in_composer_title("Some topic title for testing") topic_page.send_reply - expect(page).to have_content("Some topic title for testing") + expect(page).to have_no_selector(".topic-post.staged") topic = Topic.where(user: current_user).last expect(page).to have_current_path(topic.url) - within topic_page.post_by_number(1) do - expect(page).to have_css(".chat-transcript") - end - - # ensure the transcript date is formatted - expect(page).to have_css(".chat-transcript-datetime a[data-date-formatted=\"true\"]") + within(topic_page.post_by_number(1)) { expect(page).to have_css(".chat-transcript") } end context "when on mobile" do