A platform for community discussion. Free, open, simple.
DEV: Fix bookmark system spec flaky (#22630)
Martin Brennanb2ff00cc74a9
diff --git a/spec/system/bookmarks_spec.rb b/spec/system/bookmarks_spec.rbindex a16eb786b1d..732b130c9d1 100644--- a/spec/system/bookmarks_spec.rb+++ b/spec/system/bookmarks_spec.rb@@ -108,6 +108,7 @@ describe "Bookmarking posts and topics", type: :system doexpect(dialog).to have_content(I18n.t("js.bookmarks.confirm_clear"))dialog.click_yesexpect(dialog).to be_closed+ expect(topic_page).to have_no_bookmarksexpect(Bookmark.where(user: current_user).count).to eq(0)endenddiff --git a/spec/system/page_objects/pages/topic.rb b/spec/system/page_objects/pages/topic.rbindex 15b7e23c926..b791f537922 100644--- a/spec/system/page_objects/pages/topic.rb+++ b/spec/system/page_objects/pages/topic.rb@@ -88,6 +88,10 @@ module PageObjectshas_css?("#{topic_footer_button_id("bookmark")}.bookmarked", text: "Edit Bookmark")end+ def has_no_bookmarks?+ has_no_css?("#{topic_footer_button_id("bookmark")}.bookmarked")+ end+def find_topic_footer_button(button)find(topic_footer_button_id(button))end