mirror of
https://github.com/discourse/discourse.git
synced 2024-11-24 18:00:39 -06:00
DEV: fix flaky back to forum spec (#25071)
Fixes a flaky test by ensuring Capybara finishes loading the topic page before attempting to open chat. The back to forum url relies on a tracked property (previous url), which is set when visiting the topic page.
This commit is contained in:
parent
2b3a572987
commit
406f4c9e80
@ -55,12 +55,15 @@ RSpec.describe "Navigation", type: :system do
|
||||
expect(page).to have_css("a.c-heading[href='#{chat_path}']")
|
||||
end
|
||||
|
||||
it "has the back to forum link", mobile: true do
|
||||
it "has the back to forum link with last visited url", mobile: true do
|
||||
visit("/")
|
||||
find("a[href='#{topic.relative_url}']").click
|
||||
click_link(topic.title)
|
||||
|
||||
expect(page).to have_css(".fancy-title")
|
||||
|
||||
chat_page.open_from_header
|
||||
|
||||
expect(page).to have_title(I18n.t("js.chat.heading"))
|
||||
expect(page).to have_css(".back-to-forum[href='#{topic.relative_url}']")
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user