|
7 | 7 |
|
8 | 8 | before { sign_in user } |
9 | 9 |
|
10 | | - RSpec.shared_examples "topic thumbnails" do |
11 | | - { |
12 | | - "grid" => "grid", |
13 | | - "minimal-grid" => "minimal", |
14 | | - "list" => "list", |
15 | | - "blog-style" => "blog-style-grid", |
16 | | - }.each do |style, class_name| |
17 | | - it "renders topic thumbnails in #{style} style" do |
18 | | - theme.update_setting(:default_thumbnail_mode, style) |
19 | | - theme.save! |
20 | | - |
21 | | - visit "/latest" |
22 | | - |
23 | | - expect(page).to have_css(".topic-list.topic-thumbnails-#{class_name}") |
24 | | - expect(page).to have_css(".topic-list-thumbnail", count: 5) |
25 | | - end |
26 | | - end |
27 | | - |
28 | | - it "renders topic thumbnails in masonry style" do |
29 | | - theme.update_setting(:default_thumbnail_mode, "masonry") |
| 10 | + { |
| 11 | + "grid" => "grid", |
| 12 | + "minimal-grid" => "minimal", |
| 13 | + "list" => "list", |
| 14 | + "blog-style" => "blog-style-grid", |
| 15 | + }.each do |style, class_name| |
| 16 | + it "renders topic thumbnails in #{style} style" do |
| 17 | + theme.update_setting(:default_thumbnail_mode, style) |
30 | 18 | theme.save! |
31 | 19 |
|
32 | 20 | visit "/latest" |
33 | 21 |
|
34 | | - expect(page).to have_css(".topic-list.topic-thumbnails-masonry") |
| 22 | + expect(page).to have_css(".topic-list.topic-thumbnails-#{class_name}") |
35 | 23 | expect(page).to have_css(".topic-list-thumbnail", count: 5) |
36 | | - |
37 | | - expect(page).to have_css(".topic-list-item.masonry-0") |
38 | 24 | end |
39 | 25 | end |
40 | 26 |
|
41 | | - context "with default raw-hbs topic list" do |
42 | | - before { SiteSetting.glimmer_topic_list_mode = "disabled" } |
43 | | - |
44 | | - it "is using legacy topic list" do |
45 | | - visit "/latest" |
46 | | - expect(page).to have_css(".topic-list.ember-view") |
47 | | - end |
48 | | - |
49 | | - it_behaves_like "topic thumbnails" |
50 | | - end |
| 27 | + it "renders topic thumbnails in masonry style" do |
| 28 | + theme.update_setting(:default_thumbnail_mode, "masonry") |
| 29 | + theme.save! |
51 | 30 |
|
52 | | - context "with glimmer topic list" do |
53 | | - before { SiteSetting.glimmer_topic_list_mode = "auto" } |
| 31 | + visit "/latest" |
54 | 32 |
|
55 | | - it "is using glimmer topic list" do |
56 | | - visit "/latest" |
57 | | - expect(page).to have_css(".topic-list:not(.ember-view)") |
58 | | - end |
| 33 | + expect(page).to have_css(".topic-list.topic-thumbnails-masonry") |
| 34 | + expect(page).to have_css(".topic-list-thumbnail", count: 5) |
59 | 35 |
|
60 | | - it_behaves_like "topic thumbnails" |
| 36 | + expect(page).to have_css(".topic-list-item.masonry-0") |
61 | 37 | end |
62 | 38 | end |
0 commit comments