mirror of
https://github.com/discourse/discourse.git
synced 2026-08-04 10:23:17 -05:00
DEV: Remove flaky system test and replace it with simpler unit test (#31855)
This commit removes a system test that has been flaky in Github's CI and
replaces it with a much simpler unit test that covers the fix introduced
in 48c8ed49d6
### Reviewer notes
Example of multiple flakes in CI:
1.
https://github.com/discourse/discourse/actions/runs/13888933997/job/38857572872
2.
https://github.com/discourse/discourse/actions/runs/13793587465/job/38579530997
This commit is contained in:
@@ -107,6 +107,11 @@ RSpec.describe TopicsBulkAction do
|
||||
|
||||
PostDestroyer.new(Fabricate(:admin), p).destroy
|
||||
|
||||
TopicTrackingState.expects(:publish_dismiss_new_posts).with(
|
||||
post1.user_id,
|
||||
topic_ids: [post1.topic_id],
|
||||
)
|
||||
|
||||
TopicsBulkAction.new(post1.user, [post1.topic_id], type: "dismiss_posts").perform!
|
||||
|
||||
tu = TopicUser.find_by(user_id: post1.user_id, topic_id: post1.topic_id)
|
||||
|
||||
@@ -14,28 +14,6 @@ RSpec.describe "Dismissing New", type: :system do
|
||||
fab!(:post1) { create_post(user: user, topic: topic) }
|
||||
fab!(:post2) { create_post(topic: topic) }
|
||||
|
||||
it "should remove the unread post across sessions after the user dismisses it" do
|
||||
sign_in(user)
|
||||
|
||||
visit("/unread")
|
||||
|
||||
expect(topic_list_controls).to have_unread(count: 1)
|
||||
|
||||
using_session(:tab_1) do
|
||||
sign_in(user)
|
||||
|
||||
visit("/unread")
|
||||
|
||||
expect(topic_list_controls).to have_unread(count: 1)
|
||||
end
|
||||
|
||||
topic_list_controls.dismiss_unread
|
||||
|
||||
expect(topic_list_controls).to have_unread(count: 0)
|
||||
|
||||
using_session(:tab_1) { expect(topic_list_controls).to have_unread(count: 0) }
|
||||
end
|
||||
|
||||
it "should untrack topics across sessions after the user dismisses it" do
|
||||
sign_in(user)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user