Skip to content

A platform for community discussion. Free, open, simple.

DEV: Bump unified new upcoming change to Beta (#41454)

Martin Brennan7b0bc78f8c58
diff --git a/config/site_settings.yml b/config/site_settings.yml
index 5b0645ec7cd..a879ffb3023 100644
--- a/config/site_settings.yml
+++ b/config/site_settings.yml
@@ -4550,7 +4550,7 @@ experimental:
client: true
refresh: true
upcoming_change:
- status: "alpha"
+ status: "beta"
impact: "feature,all_members"
learn_more_url: "https://meta.discourse.org/t/-/404728"
enable_rich_text_paste:
diff --git a/frontend/discourse/tests/acceptance/topic-discovery-tracked-test.js b/frontend/discourse/tests/acceptance/topic-discovery-tracked-test.js
index ea588732a9f..260a19feff7 100644
--- a/frontend/discourse/tests/acceptance/topic-discovery-tracked-test.js
+++ b/frontend/discourse/tests/acceptance/topic-discovery-tracked-test.js
@@ -12,6 +12,7 @@ import { i18n } from "discourse-i18n";
acceptance("Topic Discovery Tracked", function (needs) {
needs.user({
+ unified_new_enabled: true,
tracked_tags: [1],
watched_tags: [2],
watching_first_post_tags: [3],
@@ -95,12 +96,8 @@ acceptance("Topic Discovery Tracked", function (needs) {
);
assert
- .dom("#navigation-bar li.unread a")
- .hasAttribute(
- "href",
- "/unread?f=tracked",
- "unread link has tracked filter"
- );
+ .dom("#navigation-bar li.unread")
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new a")
@@ -194,15 +191,12 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title_with_count", { count: 4 }),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
.hasText(
- i18n("filters.new.title_with_count", { count: 2 }),
+ i18n("filters.new.title_with_count", { count: 6 }),
"displays the right content on new link"
);
@@ -210,15 +204,12 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title_with_count", { count: 3 }),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
.hasText(
- i18n("filters.new.title_with_count", { count: 1 }),
+ i18n("filters.new.title_with_count", { count: 4 }),
"displays the right content on new link"
);
@@ -244,15 +235,12 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title_with_count", { count: 2 }),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
.hasText(
- i18n("filters.new.title"),
+ i18n("filters.new.title_with_count", { count: 2 }),
"displays the right content on new link"
);
});
@@ -276,10 +264,7 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title"),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
@@ -292,10 +277,7 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title"),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
@@ -358,15 +340,12 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title_with_count", { count: 1 }),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
.hasText(
- i18n("filters.new.title"),
+ i18n("filters.new.title_with_count", { count: 1 }),
"displays the right content on new link"
);
@@ -374,10 +353,7 @@ acceptance("Topic Discovery Tracked", function (needs) {
assert
.dom("#navigation-bar li.unread")
- .hasText(
- i18n("filters.unread.title"),
- "displays the right content on unread link"
- );
+ .doesNotExist("unread link is not displayed");
assert
.dom("#navigation-bar li.new")
diff --git a/spec/lib/homepage_helper_spec.rb b/spec/lib/homepage_helper_spec.rb
index 029e29b2d91..527e2ea1aa8 100644
--- a/spec/lib/homepage_helper_spec.rb
+++ b/spec/lib/homepage_helper_spec.rb
@@ -46,7 +46,7 @@ RSpec.describe HomepageHelper do
end
context "when first item in top menu is not valid for anons" do
- before { SiteSetting.top_menu = "new|top|latest|unread" }
+ before { SiteSetting.top_menu = "new|top|latest" }
it "distinguishes between auth homepage and anon homepage" do
expect(HomepageHelper.resolve(nil, user)).to eq("new")
@@ -59,7 +59,7 @@ RSpec.describe HomepageHelper do
context "with login required" do
before do
SiteSetting.login_required = true
- SiteSetting.top_menu = "new|top|latest|unread"
+ SiteSetting.top_menu = "new|top|latest"
end
it "returns a blank route for anon, first result from top menu for authenticated user" do
diff --git a/spec/models/topic_tracking_state_spec.rb b/spec/models/topic_tracking_state_spec.rb
index 54e89971f10..48fc9bff570 100644
--- a/spec/models/topic_tracking_state_spec.rb
+++ b/spec/models/topic_tracking_state_spec.rb
@@ -852,81 +852,59 @@ RSpec.describe TopicTrackingState do
describe ".report_totals" do
fab!(:user2, :user)
- it "correctly returns new/unread totals" do
+ it "correctly returns combined new + unread totals" do
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 0, unread: 0 })
+ expect(report).to eq({ new: 0 })
post.topic.notifier.watch_topic!(post.topic.user_id)
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 1, unread: 0 })
+ expect(report).to eq({ new: 1 })
create_post(user: user, topic: post.topic)
- # when user replies, they have 0 new count
+ # when user replies, they have 0 combined new+unread count
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 0, unread: 0 })
+ expect(report).to eq({ new: 0 })
- # when we reply the poster will have an unread item
+ # when we reply the poster will have one combined new+unread item
report = TopicTrackingState.report_totals(post.user)
- expect(report).to eq({ new: 0, unread: 1 })
+ expect(report).to eq({ new: 1 })
create_post(user: user2, topic: post.topic)
- # when a third user replies, the original user should have an unread item
+ # when a third user replies, the original user should have one combined new+unread item
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 0, unread: 1 })
+ expect(report).to eq({ new: 1 })
- # the post user still has one unread
+ # the post user still has one combined new+unread item
report = TopicTrackingState.report_totals(post.user)
- expect(report).to eq({ new: 0, unread: 1 })
+ expect(report).to eq({ new: 1 })
post2 = create_post
post2.topic.notifier.watch_topic!(user.id)
- # watching another new topic bumps the new count
+ # watching another new topic bumps the combined new+unread count
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 1, unread: 1 })
+ expect(report).to eq({ new: 2 })
end
it "respects treat_as_new_topic_start_date user option" do
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 0, unread: 0 })
+ expect(report).to eq({ new: 0 })
post.topic.notifier.watch_topic!(post.topic.user_id)
report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 1, unread: 0 })
+ expect(report).to eq({ new: 1 })
user.user_option.new_topic_duration_minutes = 5
user.user_option.save
post.topic.created_at = 10.minutes.ago
post.topic.save
- report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 0, unread: 0 })
- end
-
- it "respects unified_new_enabled" do
- SiteSetting.enable_unified_new = true
-
report = TopicTrackingState.report_totals(user)
expect(report).to eq({ new: 0 })
-
- post.topic.notifier.watch_topic!(post.topic.user_id)
-
- post2 = create_post
- Fabricate(:post, topic: post2.topic)
-
- tracking = {
- notification_level: TopicUser.notification_levels[:tracking],
- last_read_post_number: 1,
- }
-
- TopicUser.change(user.id, post2.topic_id, tracking)
-
- report = TopicTrackingState.report_totals(user)
- expect(report).to eq({ new: 2 })
end
end
diff --git a/spec/requests/list_controller_spec.rb b/spec/requests/list_controller_spec.rb
index 96485914bc0..9c6add11f8d 100644
--- a/spec/requests/list_controller_spec.rb
+++ b/spec/requests/list_controller_spec.rb
@@ -8,7 +8,7 @@ RSpec.describe ListController do
before do
admin # to skip welcome wizard at home page `/`
- SiteSetting.top_menu = "latest|new|unread|categories"
+ SiteSetting.top_menu = "latest|new|categories"
end
describe "#index" do
diff --git a/spec/requests/topics_controller_spec.rb b/spec/requests/topics_controller_spec.rb
index de314af2f2c..f2b6eeba2ba 100644
--- a/spec/requests/topics_controller_spec.rb
+++ b/spec/requests/topics_controller_spec.rb
@@ -5541,7 +5541,9 @@ RSpec.describe TopicsController do
tracked_topic = create_post(category: tracked_category).topic
create_post # This is a new post, but is not tracked so a record will not be created for it
- expect do put "/topics/reset-new.json?tracked=true" end.to change {
+ expect do
+ put "/topics/reset-new.json?tracked=true", params: { dismiss_topics: true }
+ end.to change {
DismissedTopicUser.where(user_id: user.id, topic_id: tracked_topic.id).count
}.by(1)
end
@@ -5557,7 +5559,7 @@ RSpec.describe TopicsController do
it "creates dismissed topic user records if there are > 30 (default pagination) topics" do
expect do
stub_const(TopicQuery, "DEFAULT_PER_PAGE_COUNT", 2) do
- put "/topics/reset-new.json?tracked=true"
+ put "/topics/reset-new.json?tracked=true", params: { dismiss_topics: true }
end
end.to change {
DismissedTopicUser.where(user_id: user.id, topic_id: @tracked_topic_ids).count
@@ -5571,6 +5573,7 @@ RSpec.describe TopicsController do
stub_const(TopicQuery, "DEFAULT_PER_PAGE_COUNT", 2) do
put "/topics/reset-new.json?tracked=true",
params: {
+ dismiss_topics: true,
topic_ids: dismissing_topic_ids,
}
end
@@ -5590,7 +5593,7 @@ RSpec.describe TopicsController do
it "updates the user_stat new_since column and dismisses all the new topics" do
old_new_since = user.user_stat.new_since
- put "/topics/reset-new.json?tracked=false"
+ put "/topics/reset-new.json?tracked=false", params: { dismiss_topics: true }
expect(DismissedTopicUser.where(user_id: user.id, topic_id: @topic_ids).count).to eq(
7,
)
@@ -5603,9 +5606,9 @@ RSpec.describe TopicsController do
DismissedTopicUser.create(user_id: user.id, topic_id: dismiss_ids.first)
DismissedTopicUser.create(user_id: user.id, topic_id: dismiss_ids.second)
- expect { put "/topics/reset-new.json?tracked=false" }.to change {
- DismissedTopicUser.where(user_id: user.id).count
- }.by(5)
+ expect do
+ put "/topics/reset-new.json?tracked=false", params: { dismiss_topics: true }
+ end.to change { DismissedTopicUser.where(user_id: user.id).count }.by(5)
end
end
end
@@ -5622,7 +5625,7 @@ RSpec.describe TopicsController do
topic_ids: [category_topic.id],
)
- put "/topics/reset-new.json?category_id=#{category.id}"
+ put "/topics/reset-new.json?category_id=#{category.id}", params: { dismiss_topics: true }
expect(DismissedTopicUser.where(user_id: user.id).pluck(:topic_id)).to eq(
[category_topic.id],
@@ -5635,7 +5638,10 @@ RSpec.describe TopicsController do
topic_ids: [category_topic.id, subcategory_topic.id],
)
- put "/topics/reset-new.json?category_id=#{category.id}&include_subcategories=true"
+ put "/topics/reset-new.json?category_id=#{category.id}&include_subcategories=true",
+ params: {
+ dismiss_topics: true,
+ }
expect(response.status).to eq(200)
@@ -5655,7 +5661,10 @@ RSpec.describe TopicsController do
topic_ids: [category_topic.id, subcategory_topic.id, sub_subcategory_topic.id],
)
- put "/topics/reset-new.json?category_id=#{category.id}&include_subcategories=true"
+ put "/topics/reset-new.json?category_id=#{category.id}&include_subcategories=true",
+ params: {
+ dismiss_topics: true,
+ }
expect(response.status).to eq(200)
@@ -5685,6 +5694,7 @@ RSpec.describe TopicsController do
MessageBus.track_publish(TopicTrackingState.unread_channel_key(user.id)) do
put "/topics/reset-new.json",
params: {
+ dismiss_topics: true,
category_id: category.id,
include_subcategories: true,
}
@@ -5712,6 +5722,7 @@ RSpec.describe TopicsController do
MessageBus.track_publish(TopicTrackingState.unread_channel_key(user.id)) do
put "/topics/reset-new.json",
params: {
+ dismiss_topics: true,
category_id: category.id,
include_subcategories: true,
}
@@ -5743,7 +5754,11 @@ RSpec.describe TopicsController do
it "doesn't dismiss topics or publish topic IDs via MessageBus if the user can't access the category" do
messages =
MessageBus.track_publish do
- put "/topics/reset-new.json", params: { category_id: private_category.id }
+ put "/topics/reset-new.json",
+ params: {
+ dismiss_topics: true,
+ category_id: private_category.id,
+ }
expect(response.status).to eq(200)
end
@@ -5755,7 +5770,11 @@ RSpec.describe TopicsController do
group.add(user)
messages =
MessageBus.track_publish do
- put "/topics/reset-new.json", params: { category_id: private_category.id }
+ put "/topics/reset-new.json",
+ params: {
+ dismiss_topics: true,
+ category_id: private_category.id,
+ }
end
expect(response.status).to eq(200)
expect(messages.size).to eq(1)
@@ -5778,7 +5797,7 @@ RSpec.describe TopicsController do
it "dismisses topics for tag" do
TopicTrackingState.expects(:publish_dismiss_new).with(user.id, topic_ids: [tag_topic.id])
- put "/topics/reset-new.json?tag_name=#{tag.name}"
+ put "/topics/reset-new.json?tag_name=#{tag.name}", params: { dismiss_topics: true }
expect(DismissedTopicUser.where(user_id: user.id).pluck(:topic_id)).to eq([tag_topic.id])
end
@@ -5800,7 +5819,11 @@ RSpec.describe TopicsController do
group.add(user)
messages =
MessageBus.track_publish do
- put "/topics/reset-new.json", params: { tag_name: restricted_tag.name }
+ put "/topics/reset-new.json",
+ params: {
+ dismiss_topics: true,
+ tag_name: restricted_tag.name,
+ }
end
expect(messages.size).to eq(1)
expect(messages[0].data["payload"]["topic_ids"]).to contain_exactly(
@@ -5814,7 +5837,11 @@ RSpec.describe TopicsController do
it "ignores the tag param and dismisses all topics if the user can't see the tag" do
messages =
MessageBus.track_publish do
- put "/topics/reset-new.json", params: { tag_name: restricted_tag.name }
+ put "/topics/reset-new.json",
+ params: {
+ dismiss_topics: true,
+ tag_name: restricted_tag.name,
+ }
end
expect(messages.size).to eq(1)
expect(messages[0].data["payload"]["topic_ids"]).to contain_exactly(
@@ -5842,7 +5869,10 @@ RSpec.describe TopicsController do
user.id,
topic_ids: [tag_and_category_topic.id],
)
- put "/topics/reset-new.json?tag_name=#{tag.name}&category_id=#{category.id}"
+ put "/topics/reset-new.json?tag_name=#{tag.name}&category_id=#{category.id}",
+ params: {
+ dismiss_topics: true,
+ }
expect(DismissedTopicUser.where(user_id: user.id).pluck(:topic_id)).to eq(
[tag_and_category_topic.id],
)
@@ -5859,7 +5889,8 @@ RSpec.describe TopicsController do
.with(user.id, topic_ids: [topic2.id, topic3.id])
.at_least_once
- put "/topics/reset-new.json", **{ params: { topic_ids: [topic2.id, topic3.id] } }
+ put "/topics/reset-new.json",
+ **{ params: { dismiss_topics: true, topic_ids: [topic2.id, topic3.id] } }
expect(response.status).to eq(200)
user.reload
expect(user.user_stat.new_since.to_date).not_to eq(old_date.to_date)
@@ -5883,7 +5914,11 @@ RSpec.describe TopicsController do
messages =
MessageBus.track_publish do
- put "/topics/reset-new.json", params: { topic_ids: [topic2.id, topic3.id] }
+ put "/topics/reset-new.json",
+ params: {
+ dismiss_topics: true,
+ topic_ids: [topic2.id, topic3.id],
+ }
end
expect(messages.size).to eq(1)
expect(messages[0].channel).to eq(TopicTrackingState.unread_channel_key(user.id))
@@ -5913,7 +5948,12 @@ RSpec.describe TopicsController do
create_post # This is a new post, but is not tracked so a record will not be created for it
expect do
put "/topics/reset-new.json?tracked=true",
- **{ params: { topic_ids: [tracked_topic.id, topic2.id, topic3.id] } }
+ **{
+ params: {
+ dismiss_topics: true,
+ topic_ids: [tracked_topic.id, topic2.id, topic3.id],
+ },
+ }
end.to change { DismissedTopicUser.where(user_id: user.id).count }.by(2)
expect(DismissedTopicUser.where(user_id: user.id).pluck(:topic_id)).to match_array(
[tracked_topic.id, topic2.id],
diff --git a/spec/system/dismissing_new_spec.rb b/spec/system/dismissing_new_spec.rb
index f3a57a24b1e..0b03f4a9033 100644
--- a/spec/system/dismissing_new_spec.rb
+++ b/spec/system/dismissing_new_spec.rb
@@ -8,15 +8,17 @@ RSpec.describe "Dismissing New" do
let(:topic_list) { PageObjects::Components::TopicList.new }
let(:topic_view) { PageObjects::Components::TopicView.new }
- describe "when a user has an unread post" do
+ before { SiteSetting.enable_unified_new = true }
+
+ describe "when a user has a new reply" do
fab!(:topic) { Fabricate(:topic, user: user) }
fab!(:post1) { create_post(user: user, topic: topic) }
fab!(:post2) { create_post(topic: topic) }
- it "should untrack topics across sessions after the user dismisses it" do
+ it "lets the user stop tracking replies across sessions" do
sign_in(user)
- visit("/unread")
+ visit("/new?subset=replies")
using_session(:tab_1) do
sign_in(user)
@@ -26,7 +28,7 @@ RSpec.describe "Dismissing New" do
expect(topic_view).to have_tracking_status("tracking")
end
- topic_list_controls.dismiss_unread(untrack: true)
+ topic_list_controls.dismiss_new_and_stop_tracking
using_session(:tab_1) do
try_until_success(reason: "relies on MessageBus updates") do
@@ -35,7 +37,7 @@ RSpec.describe "Dismissing New" do
end
end
- context "when dismissing new on a category's topic list" do
+ context "when viewing a category's topic list" do
fab!(:category, :category_with_definition)
fab!(:subcategory) { Fabricate(:category_with_definition, parent_category: category) }
fab!(:category_topic) { Fabricate(:topic, category: category, user: user) }
@@ -45,16 +47,16 @@ RSpec.describe "Dismissing New" do
fab!(:subcategory_post1) { create_post(user: user, topic: subcategory_topic) }
fab!(:subcategory_post2) { create_post(topic: subcategory_topic) }
- it "should dismiss unread posts for the category and its subcategories" do
+ it "lets the user dismiss replies for the category and subcategories" do
sign_in(user)
- visit("/c/#{category.id}/l/unread")
+ visit("/c/#{category.slug}/#{category.id}/l/new?subset=replies")
- expect(topic_list_controls).to have_unread(count: 2)
+ expect(topic_list).to have_topics(count: 2)
- topic_list_controls.dismiss_unread
+ topic_list_controls.dismiss_new
- expect(topic_list_controls).to have_unread(count: 0)
+ expect(topic_list).to have_no_topics
end
end
end
@@ -62,18 +64,18 @@ RSpec.describe "Dismissing New" do
describe "when a user has a new topic" do
fab!(:topic)
- it "should remove the new topic across sessions after the user dismisses it" do
+ it "lets the user dismiss the new topic across sessions" do
tab_1 = open_new_window(:tab)
switch_to_window(tab_1)
sign_in(user)
- visit("/new")
+ visit("/new?subset=topics")
expect(topic_list_controls).to have_new(count: 1)
tab_2 = open_new_window(:tab)
switch_to_window(tab_2)
sign_in(user)
- visit("/new")
+ visit("/new?subset=topics")
expect(topic_list_controls).to have_new(count: 1)
@@ -87,14 +89,12 @@ RSpec.describe "Dismissing New" do
end
end
- describe "when unified new is enabled" do
+ describe "when a user has new topics and replies" do
fab!(:new_topic) { Fabricate(:topic, user: user) }
fab!(:post1) { create_post(user: user) }
fab!(:post2) { create_post(topic: post1.topic) }
- before { SiteSetting.enable_unified_new = true }
-
- it "should remove the new topic and post across sessions after the user dismisses it" do
+ it "lets the user dismiss topics and replies across sessions" do
tab_1 = open_new_window(:tab)
switch_to_window(tab_1)
sign_in(user)
diff --git a/spec/system/homepage_spec.rb b/spec/system/homepage_spec.rb
index 37774e07d9e..311f73713c1 100644
--- a/spec/system/homepage_spec.rb
+++ b/spec/system/homepage_spec.rb
@@ -40,7 +40,7 @@ describe "Homepage" do
end
it "defaults to first top_menu item as anonymous homepage" do
- SiteSetting.top_menu = "categories|latest|new|unread"
+ SiteSetting.top_menu = "categories|latest|new"
visit "/"
expect(page).to have_css(".navigation-container .categories.active", text: "Categories")
diff --git a/spec/system/login_spec.rb b/spec/system/login_spec.rb
index 41c71c2d4dd..e2b3a716a1d 100644
--- a/spec/system/login_spec.rb
+++ b/spec/system/login_spec.rb
@@ -179,7 +179,7 @@ shared_examples "login scenarios" do
end
it "does not leak category metadata if homepage is /categories" do
- SiteSetting.top_menu = "categories|latest|new|unread|top"
+ SiteSetting.top_menu = "categories|latest|new|top"
visit "/"
expect(page).to have_css(".login-welcome")
diff --git a/spec/system/page_objects/components/topic_list_controls.rb b/spec/system/page_objects/components/topic_list_controls.rb
index 06fd8172a72..bd25fcdcdb9 100644
--- a/spec/system/page_objects/components/topic_list_controls.rb
+++ b/spec/system/page_objects/components/topic_list_controls.rb
@@ -14,24 +14,6 @@ module PageObjects
has_css?(".nav-item_new", exact_text: text)
end
- def has_unread?(count:)
- text =
- if count == 0
- I18n.t("js.filters.unread.title")
- else
- I18n.t("js.filters.unread.title_with_count", count: count)
- end
-
- has_css?(".nav-item_unread", exact_text: text)
- end
-
- def dismiss_unread(untrack: false)
- click_button("dismiss-topics-top")
- find(".dismiss-read-modal__stop-tracking").click if untrack
- click_button("dismiss-read-confirm")
- self
- end
-
def dismiss_new
click_button("dismiss-new-top")
self
diff --git a/spec/system/topic_bulk_select_spec.rb b/spec/system/topic_bulk_select_spec.rb
index 8af2c170c73..0420942ce9c 100644
--- a/spec/system/topic_bulk_select_spec.rb
+++ b/spec/system/topic_bulk_select_spec.rb
@@ -25,14 +25,16 @@ describe "Topic bulk select" do
expect(topic_bulk_actions_modal).to be_open
end
- context "when dismissing unread topics" do
+ context "when dismissing new replies" do
fab!(:topic) { Fabricate(:topic, user: admin) }
fab!(:post1) { create_post(user: admin, topic: topic) }
fab!(:post2) { create_post(topic: topic) }
+ before { SiteSetting.enable_unified_new = true }
+
it "removes the topics from the list" do
sign_in(admin)
- visit("/unread")
+ visit("/new?subset=replies")
topic_list_header.click_bulk_select_button
expect(topic_list).to have_topic_checkbox(topic)
@@ -40,11 +42,9 @@ describe "Topic bulk select" do
topic_list.click_topic_checkbox(topic)
topic_list_header.click_bulk_select_topics_dropdown
- topic_list_header.click_bulk_button("dismiss-unread")
-
- topic_bulk_actions_modal.click_dismiss_confirm
+ topic_list_header.click_bulk_button("dismiss-new")
- expect(page).to have_text(I18n.t("js.topics.none.education.unread"))
+ expect(topic_list).to have_no_topics
end
it "turns off bulk select after dismissing" do
@@ -53,15 +53,13 @@ describe "Topic bulk select" do
create_post(topic: other_topic)
sign_in(admin)
- visit("/unread")
+ visit("/new?subset=replies")
topic_list_header.click_bulk_select_button
topic_list.click_topic_checkbox(topic)
topic_list_header.click_bulk_select_topics_dropdown
- topic_list_header.click_bulk_button("dismiss-unread")
-
- topic_bulk_actions_modal.click_dismiss_confirm
+ topic_list_header.click_bulk_button("dismiss-new")
expect(topic_list).to have_topic(other_topic)
expect(topic_list).to have_no_topic_checkbox(other_topic)
@@ -74,6 +72,8 @@ describe "Topic bulk select" do
let(:topic_list_controls) { PageObjects::Components::TopicListControls.new }
+ before { SiteSetting.enable_unified_new = true }
+
context "with the bulk actions dropdown" do
it "removes the topics from the list" do
sign_in(admin)
@@ -414,6 +414,8 @@ describe "Topic bulk select" do
end
it "works with keyboard shortcuts" do
+ SiteSetting.enable_unified_new = true
+
sign_in(admin)
visit("/latest")
@@ -428,14 +430,14 @@ describe "Topic bulk select" do
send_keys("x") # toggle deselect
expect(topic_list).to have_no_checkbox_selected_on_row(1)
- # watch topic and add a reply so we have something in /unread
+ # watch topic and add a reply so we have something in /new?subset=replies
topic = topics.first
visit("/t/#{topic.slug}/#{topic.id}")
topic_page.watch_topic
expect(topic_page).to have_read_post(1)
Fabricate(:post, topic: topic)
- visit("/unread")
+ visit("/new?subset=replies")
expect(topic_list).to have_topics
send_keys([:shift, "b"])
@@ -444,8 +446,6 @@ describe "Topic bulk select" do
send_keys("x")
send_keys([:shift, "d"])
- click_button("dismiss-read-confirm")
-
expect(topic_list).to have_no_topics
end
end
diff --git a/spec/system/viewing_category_spec.rb b/spec/system/viewing_category_spec.rb
index a50d2da9a56..6f71942c54d 100644
--- a/spec/system/viewing_category_spec.rb
+++ b/spec/system/viewing_category_spec.rb
@@ -6,6 +6,8 @@ RSpec.describe "Viewing a category" do
let(:category_page) { PageObjects::Pages::Category.new }
let(:topic_list) { PageObjects::Components::TopicList.new }
+ before { SiteSetting.enable_unified_new = true }
+
describe "when a new child category is created with a new category topic" do
fab!(:child_category) { Fabricate(:category, parent_category: category) }
@@ -15,7 +17,7 @@ RSpec.describe "Viewing a category" do
end
end
- it "should show a new count on the parent and child category when 'show_category_definitions_in_topic_lists' is true" do
+ it "shows the category topic on the parent and child new lists when category definitions are shown" do
SiteSetting.show_category_definitions_in_topic_lists = true
sign_in(user)
@@ -33,19 +35,17 @@ RSpec.describe "Viewing a category" do
expect(topic_list).to have_topic(child_category_topic)
end
- it "should only show a new count on the child category when 'show_category_definitions_in_topic_lists' site setting is false" do
+ it "shows the category topic only on the child new list when category definitions are hidden" do
SiteSetting.show_category_definitions_in_topic_lists = false
sign_in(user)
category_page.visit(category)
+ category_page.click_new
- expect(category_page).to have_no_new_topics
+ expect(topic_list).to have_no_topic(child_category_topic)
category_page.visit(child_category)
-
- expect(category_page).to have_new_topics
-
category_page.click_new
expect(topic_list).to have_topics(count: 1)
diff --git a/spec/system/welcome_banner_spec.rb b/spec/system/welcome_banner_spec.rb
index b17fe165594..6c3c335bd93 100644
--- a/spec/system/welcome_banner_spec.rb
+++ b/spec/system/welcome_banner_spec.rb
@@ -91,8 +91,6 @@ describe "Welcome banner" do
expect(banner).to be_visible
visit "/new"
expect(banner).to be_visible
- visit "/unread"
- expect(banner).to be_visible
visit "/hot"
expect(banner).to be_visible
visit "/tags"