From e6f8897450a7c1371817f31b588997079af8e9e3 Mon Sep 17 00:00:00 2001 From: Jarek Radosz Date: Tue, 13 Jun 2023 11:05:19 +0200 Subject: [PATCH] DEV: Try to de-flake topic page specs (#22065) --- spec/system/topic_page_spec.rb | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/spec/system/topic_page_spec.rb b/spec/system/topic_page_spec.rb index 469ea9178d1..a4e8c26a145 100644 --- a/spec/system/topic_page_spec.rb +++ b/spec/system/topic_page_spec.rb @@ -13,10 +13,9 @@ describe "Topic page", type: :system do it "allows TOC anchor navigation" do visit("/t/#{topic.slug}/#{topic.id}") - find("#toc-h2-testing").hover - find("a.anchor").click + find("#toc-h2-testing .anchor", visible: :all).click - try_until_success(timeout: 10) do + try_until_success do expect(current_url).to match("/t/#{topic.slug}/#{topic.id}#toc-h2-testing") end end @@ -27,10 +26,9 @@ describe "Topic page", type: :system do it "allows TOC anchor navigation" do visit("/forum/t/#{topic.slug}/#{topic.id}") - find("#toc-h2-testing").hover - find("a.anchor").click + find("#toc-h2-testing .anchor", visible: :all).click - try_until_success(timeout: 10) do + try_until_success do expect(current_url).to match("/forum/t/#{topic.slug}/#{topic.id}#toc-h2-testing") end end