fix tests

This commit is contained in:
Joffrey JAFFEUX 2022-12-13 13:51:17 +01:00
parent 8e91c9cc92
commit 291701034c

View File

@ -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