From 64291fedf8b0651190ab5a2a751714b7a1009ab2 Mon Sep 17 00:00:00 2001 From: Kris Date: Thu, 7 Nov 2024 20:10:18 -0500 Subject: [PATCH] UX: lower min_post_count to show bottom topic map (#29649) --- .../app/components/topic-map/topic-map-summary.gjs | 2 +- spec/system/topic_map_spec.rb | 13 ++++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs index 14a39278c10..e9c924bbed0 100644 --- a/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs +++ b/app/assets/javascripts/discourse/app/components/topic-map/topic-map-summary.gjs @@ -28,7 +28,7 @@ const MIN_LIKES_COUNT = 5; const MIN_PARTICIPANTS_COUNT = 5; const MIN_USERS_COUNT_FOR_AVATARS = 2; -export const MIN_POSTS_COUNT = 10; +export const MIN_POSTS_COUNT = 5; export default class TopicMapSummary extends Component { @service site; diff --git a/spec/system/topic_map_spec.rb b/spec/system/topic_map_spec.rb index 1a83c65122f..c836d4e8cc8 100644 --- a/spec/system/topic_map_spec.rb +++ b/spec/system/topic_map_spec.rb @@ -21,8 +21,6 @@ describe "Topic Map", type: :system do topic_page.visit_topic(topic) expect(topic_page).to have_topic_map - Fabricate(:post, topic: topic, created_at: 2.day.ago) - Fabricate(:post, topic: topic, created_at: 1.day.ago, like_count: 3) 2.times { Fabricate(:post, topic: topic, created_at: 1.day.ago, like_count: 1) } page.refresh expect(topic_page).to have_topic_map @@ -30,6 +28,14 @@ describe "Topic Map", type: :system do Fabricate(:post, topic: topic, created_at: 1.day.ago) page.refresh + + # bottom map, avatars details with post counts + expect(topic_map).to have_no_bottom_map + + Fabricate(:post, topic: topic, created_at: 2.day.ago) + Fabricate(:post, topic: topic, created_at: 1.day.ago, like_count: 3) + page.refresh + expect(topic_map.users_count).to eq 6 # user count @@ -41,9 +47,6 @@ describe "Topic Map", type: :system do topic_page.visit_topic(topic) }.to change(topic_map, :users_count).by(1) - # bottom map, avatars details with post counts - expect(topic_map).to have_no_bottom_map - Fabricate(:post, topic: topic) Fabricate(:post, user: user, topic: topic) Fabricate(:post, user: last_post_user, topic: topic)