From eaeefb56fc2a936f391e7a07ec0cc0893959e162 Mon Sep 17 00:00:00 2001 From: Penar Musaraj Date: Thu, 4 Apr 2024 12:40:09 -0400 Subject: [PATCH] DEV: Fix flakey user tips spec (#26516) --- spec/system/user_tips_spec.rb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/spec/system/user_tips_spec.rb b/spec/system/user_tips_spec.rb index 3a3bf6b4ffd..9125a998342 100644 --- a/spec/system/user_tips_spec.rb +++ b/spec/system/user_tips_spec.rb @@ -37,10 +37,16 @@ describe "Homepage", type: :system do expect(page).to have_css(".fk-d-tooltip .user-tip__title", text: "Your first notification!") - # refresh the page - visit "/" - # Tip is marked as seen when it is displayed - expect(user.reload.user_option.seen_popups).to include(User.user_tips[:first_notification]) + find(".d-header #current-user").click + + # Clicking outside element dismisses the tip + expect(page).to have_no_css( + ".fk-d-tooltip .user-tip__title", + text: "Your first notification!", + ) + + page.refresh + expect(page).to have_no_css( ".fk-d-tooltip .user-tip__title", text: "Your first notification!",