DEV: Fix flakey user tips spec (#26516)

This commit is contained in:
Penar Musaraj 2024-04-04 12:40:09 -04:00 committed by GitHub
parent cab178a405
commit eaeefb56fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 10 additions and 4 deletions

View File

@ -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!",