mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:29:30 +08:00
DEV: Fix bookmark system spec flaky (#22630)
1) Bookmarking posts and topics topic level bookmarks clears all topic bookmarks from the topic bookmark button if more than one post is bookmarked Failure/Error: expect(Bookmark.where(user: current_user).count).to eq(0) expected: 0 got: 2
This commit is contained in:
parent
37fd05af4e
commit
b2ff00cc74
|
@ -108,6 +108,7 @@ describe "Bookmarking posts and topics", type: :system do
|
|||
expect(dialog).to have_content(I18n.t("js.bookmarks.confirm_clear"))
|
||||
dialog.click_yes
|
||||
expect(dialog).to be_closed
|
||||
expect(topic_page).to have_no_bookmarks
|
||||
expect(Bookmark.where(user: current_user).count).to eq(0)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -88,6 +88,10 @@ module PageObjects
|
|||
has_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
|
||||
|
|
Loading…
Reference in New Issue
Block a user