From 92bb96a501ca6076018c7d3891cb59dee843ca44 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Wed, 2 Apr 2025 11:59:17 +0100 Subject: [PATCH] DEV: Drop raw-hbs specs In preparation for https://github.com/discourse/discourse/pull/32081 --- spec/system/topic_thumbnails_spec.rb | 56 ++++++++-------------------- 1 file changed, 16 insertions(+), 40 deletions(-) diff --git a/spec/system/topic_thumbnails_spec.rb b/spec/system/topic_thumbnails_spec.rb index cae0057..b0bbde9 100644 --- a/spec/system/topic_thumbnails_spec.rb +++ b/spec/system/topic_thumbnails_spec.rb @@ -7,56 +7,32 @@ before { sign_in user } - RSpec.shared_examples "topic thumbnails" do - { - "grid" => "grid", - "minimal-grid" => "minimal", - "list" => "list", - "blog-style" => "blog-style-grid", - }.each do |style, class_name| - it "renders topic thumbnails in #{style} style" do - theme.update_setting(:default_thumbnail_mode, style) - theme.save! - - visit "/latest" - - expect(page).to have_css(".topic-list.topic-thumbnails-#{class_name}") - expect(page).to have_css(".topic-list-thumbnail", count: 5) - end - end - - it "renders topic thumbnails in masonry style" do - theme.update_setting(:default_thumbnail_mode, "masonry") + { + "grid" => "grid", + "minimal-grid" => "minimal", + "list" => "list", + "blog-style" => "blog-style-grid", + }.each do |style, class_name| + it "renders topic thumbnails in #{style} style" do + theme.update_setting(:default_thumbnail_mode, style) theme.save! visit "/latest" - expect(page).to have_css(".topic-list.topic-thumbnails-masonry") + expect(page).to have_css(".topic-list.topic-thumbnails-#{class_name}") expect(page).to have_css(".topic-list-thumbnail", count: 5) - - expect(page).to have_css(".topic-list-item.masonry-0") end end - context "with default raw-hbs topic list" do - before { SiteSetting.glimmer_topic_list_mode = "disabled" } - - it "is using legacy topic list" do - visit "/latest" - expect(page).to have_css(".topic-list.ember-view") - end - - it_behaves_like "topic thumbnails" - end + it "renders topic thumbnails in masonry style" do + theme.update_setting(:default_thumbnail_mode, "masonry") + theme.save! - context "with glimmer topic list" do - before { SiteSetting.glimmer_topic_list_mode = "auto" } + visit "/latest" - it "is using glimmer topic list" do - visit "/latest" - expect(page).to have_css(".topic-list:not(.ember-view)") - end + expect(page).to have_css(".topic-list.topic-thumbnails-masonry") + expect(page).to have_css(".topic-list-thumbnail", count: 5) - it_behaves_like "topic thumbnails" + expect(page).to have_css(".topic-list-item.masonry-0") end end