From adeba974652957c3912cfb601d34fd46411cfee5 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Fri, 25 Apr 2025 21:32:31 +0200 Subject: [PATCH] DEV: prevents double navigation Clicking on the switcher is already causing a navigation to the topic to refresh content. I this spec we were doing a `visit_topic` right after which could be working in selenium, but will often fail on playwright with the following error: ``` Playwright::Error: net::ERR_ABORTED at http://localhost:31339/t/life-strategies-from-the-art-of-war/96 Call log: - navigating to "http://localhost:31339/t/life-strategies-from-the-art-of-war/96", waiting until "load" ``` --- spec/system/anon_language_switcher_spec.rb | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/spec/system/anon_language_switcher_spec.rb b/spec/system/anon_language_switcher_spec.rb index c2d1c0ff..cb598adb 100644 --- a/spec/system/anon_language_switcher_spec.rb +++ b/spec/system/anon_language_switcher_spec.rb @@ -67,17 +67,20 @@ switcher.expand switcher.click_button("Español") + expect(find(".nav-item_latest")).to have_content("Recientes") topic_page.visit_topic(topic) - topic_page.has_topic_title?("Estrategias de vida de El arte de la guerra") + + expect(topic_page).to have_topic_title("Estrategias de vida de El arte de la guerra") switcher.expand switcher.click_button("日本語") - topic_page.visit_topic(topic) - topic_page.has_topic_title?("孫子兵法からの人生戦略") + + expect(topic_page).to have_topic_title("孫子兵法からの人生戦略") visit("/") + expect(find(".nav-item_latest")).to have_content("最新") end end