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:
Alan Guo Xiang Tan
2025-03-18 08:12:38 +08:00
committed by GitHub
parent 429a10b2b9
commit 5002f95259
2 changed files with 5 additions and 22 deletions
+5
View File
@@ -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)
-22
View File
@@ -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)