A platform for community discussion. Free, open, simple.
DEV: Reduce redundant setup and app loads in system tests (#44467)
Alan Guo Xiang Tan0000031f1e77
diff --git a/frontend/discourse/app/lib/sidebar/admin-sidebar.js b/frontend/discourse/app/lib/sidebar/admin-sidebar.jsindex d115dba757c..ea2375e8789 100644--- a/frontend/discourse/app/lib/sidebar/admin-sidebar.js+++ b/frontend/discourse/app/lib/sidebar/admin-sidebar.js@@ -389,7 +389,6 @@ export default class AdminSidebarPanel extends BaseCustomSidebarPanel {"service:site-settings");const site = getOwnerWithFallback(this).lookup("service:site");- const store = getOwnerWithFallback(this).lookup("service:store");const router = getOwnerWithFallback(this).lookup("service:router");const session = getOwnerWithFallback(this).lookup("service:session");const designWizard = getOwnerWithFallback(this).lookup(@@ -432,24 +431,6 @@ export default class AdminSidebarPanel extends BaseCustomSidebarPanel {}}- // Mods cannot access themes- if (currentUser.admin) {- store.findAll("theme").then((themes) => {- this.adminSidebarStateManager.setLinkKeywords(- "admin_themes_and_components",- themes.content- .filter((theme) => !theme.component)- .map((theme) => theme.name)- );- this.adminSidebarStateManager.setLinkKeywords(- "admin_themes_and_components",- themes.content- .filter((theme) => theme.component)- .map((theme) => theme.name)- );- });- }-if (siteSettings.enable_form_templates) {this.adminNavManager.amendLinksToSection("appearance", [{diff --git a/plugins/discourse-events/spec/system/post_event_spec.rb b/plugins/discourse-events/spec/system/post_event_spec.rbindex 03100fdba4e..774200b6846 100644--- a/plugins/discourse-events/spec/system/post_event_spec.rb+++ b/plugins/discourse-events/spec/system/post_event_spec.rb@@ -148,16 +148,15 @@ describe "Post event" doexpect(composer).to have_value(/end=2024-06-03/)end- context "when showLocalTime is set and the event crosses midnight relative to the viewer",- timezone: "Australia/Brisbane" do+ context "when showLocalTime is set and the event crosses midnight relative to the viewer" doit "renders the preview badge in the event timezone, not the viewer's" do- # 2025-09-07 22:30 Europe/Paris == 2025-09-08 06:30 Australia/Brisbane,- # so without showLocalTime the viewer would see "Sep 8" in the badge.+ # 2025-09-07 00:30 Europe/Paris == 2025-09-06 22:30 UTC,+ # so without showLocalTime the viewer would see "Sep 6" in the badge.# With showLocalTime, the preview must stay anchored to the event timezone.visit("/new-topic")composer.fill_title("Local time preview test")composer.fill_content <<~MD- [event start='2025-09-07 22:30' timezone='Europe/Paris' showLocalTime='true' status='public']+ [event start='2025-09-07 00:30' timezone='Europe/Paris' showLocalTime='true' status='public'][/event]MD@@ -208,7 +207,7 @@ describe "Post event" doendend- context "when showing local time", timezone: "Australia/Brisbane" do+ context "when showing local time" doit "correctly shows month/day" dopage.driver.with_playwright_page do |pw_page|pw_page.clock.install(time: Time.new(2025, 6, 5, 22, 0, 0))@@ -216,7 +215,7 @@ describe "Post event" dotitle = "My FR test meetup event"raw = <<~MD- [event showLocalTime='true' start='2025-09-07 17:30' timezone='Europe/Paris']+ [event showLocalTime='true' start='2025-09-07 00:30' timezone='Europe/Paris'][/event]MDpost = PostCreator.create(admin, title:, raw:)diff --git a/plugins/discourse-events/spec/system/upcoming_events_spec.rb b/plugins/discourse-events/spec/system/upcoming_events_spec.rbindex 4dcb2c66b8d..962c8fe6c9f 100644--- a/plugins/discourse-events/spec/system/upcoming_events_spec.rb+++ b/plugins/discourse-events/spec/system/upcoming_events_spec.rb@@ -448,6 +448,8 @@ describe "Upcoming Events" doendcontext "in different timezone", timezone: "Europe/London" do+ fab!(:admin) { Fabricate(:admin, timezone: "Europe/London") }+it "navigates to current date in day view", time: Time.utc(2025, 6, 2, 19, 00) dovisit("/upcoming-events/day/2025/8/1")@@ -478,6 +480,8 @@ describe "Upcoming Events" doendcontext "in different timezone", timezone: "Europe/London" do+ fab!(:admin) { Fabricate(:admin, timezone: "Europe/London") }+it "navigates to next day" dovisit("/upcoming-events/day/2025/8/4")@@ -527,6 +531,8 @@ describe "Upcoming Events" doendcontext "in different timezone", timezone: "Europe/London" do+ fab!(:admin) { Fabricate(:admin, timezone: "Europe/London") }+it "navigates to previous day" dovisit("/upcoming-events/day/2025/8/1")diff --git a/spec/fabricators/user_fabricator.rb b/spec/fabricators/user_fabricator.rbindex 2a3cc6eb0a3..3b14bade08c 100644--- a/spec/fabricators/user_fabricator.rb+++ b/spec/fabricators/user_fabricator.rb@@ -6,6 +6,7 @@ Fabricator(:user, class_name: :user) dotransient refresh_auto_groups: falsetransient trust_level: niltransient search_index: false+ transient timezone: "Etc/UTC"transient composition_mode: UserOption.composition_mode_types[:markdown]transient seen_before: false@@ -24,10 +25,13 @@ Fabricator(:user, class_name: :user) doendSearchIndexer.disable if transients[:search_index]- # TODO (martin) It would be good to remove this at some point once specs are updated+ # TODO (martin) It would be good to remove the composition mode override once specs are updated# to use the rich editor by default. Otherwise, if this is not done, there are tons# of specs failing when setting SiteSetting.default_composition_mode default to rich- user.user_option.update!(composition_mode: transients[:composition_mode])+ user.user_option.update!(+ composition_mode: transients[:composition_mode],+ timezone: transients[:timezone],+ )if transients[:seen_before]user.update!(last_seen_at: 2.days.ago, previous_visit_at: 2.days.ago)diff --git a/spec/models/user_spec.rb b/spec/models/user_spec.rbindex c0af60f3361..5fe908bf50c 100644--- a/spec/models/user_spec.rb+++ b/spec/models/user_spec.rb@@ -1500,6 +1500,8 @@ RSpec.describe User doenddescribe "update_timezone_if_missing" do+ subject(:user) { Fabricate(:user, last_seen_at: 1.day.ago, timezone: nil) }+let(:timezone) { nil }it "does nothing if timezone is nil" dodiff --git a/spec/requests/session_controller_spec.rb b/spec/requests/session_controller_spec.rbindex 59a4d370aee..ec06c72212f 100644--- a/spec/requests/session_controller_spec.rb+++ b/spec/requests/session_controller_spec.rb@@ -315,6 +315,8 @@ RSpec.describe SessionController doendcontext "when timezone param is provided" do+ let(:user) { Fabricate(:user, timezone: nil) }+it "sets the user_option timezone for the user" dopost "/session/email-login/#{email_token.token}.json",params: {@@ -3504,6 +3506,8 @@ RSpec.describe SessionController doendcontext "when timezone param is provided" do+ let(:user) { Fabricate(:user, timezone: nil) }+it "sets the user_option timezone for the user" dopost "/session.json",params: {diff --git a/spec/requests/users_controller_spec.rb b/spec/requests/users_controller_spec.rbindex 8baf021637f..88dbf99c8c8 100644--- a/spec/requests/users_controller_spec.rb+++ b/spec/requests/users_controller_spec.rb@@ -413,6 +413,8 @@ RSpec.describe UsersController doendit "sets the users timezone if the param is present" do+ user1.user_option.update!(timezone: nil)+get "/u/password-reset/#{email_token.token}"expect(user1.user_option.timezone).to eq(nil)diff --git a/spec/support/shared_contexts/prosemirror_editor_context.rb b/spec/support/shared_contexts/prosemirror_editor_context.rbindex 18ffaaae44d..7f37150f0e6 100644--- a/spec/support/shared_contexts/prosemirror_editor_context.rb+++ b/spec/support/shared_contexts/prosemirror_editor_context.rb@@ -9,13 +9,6 @@ RSpec.shared_context "with prosemirror editor" do)end- fab!(:tag)- fab!(:category_with_emoji) do- Fabricate(:category, slug: "cat", emoji: "cat", style_type: "emoji")- end- fab!(:category_with_icon) { Fabricate(:category, icon: "bell", style_type: "icon") }- fab!(:category_without_icon, :category)-let(:cdp) { PageObjects::CDP.new }let(:composer) { PageObjects::Components::Composer.new }let(:rich) { composer.rich_editor }diff --git a/spec/system/about_page_spec.rb b/spec/system/about_page_spec.rbindex 6a3cf3743b7..de871c653da 100644--- a/spec/system/about_page_spec.rb+++ b/spec/system/about_page_spec.rb@@ -105,6 +105,7 @@ describe "About page" doabout_page.visitexpect(about_page.site_activities).to have_no_activity_item("visitors")+ expect(about_page).to have_no_traffic_info_footerendend@@ -118,6 +119,7 @@ describe "About page" doexpect(about_page.site_activities.visitors).to have_text("0 visitors, about 0 from the EU",)+ expect(about_page).to have_traffic_info_footerendendend@@ -172,24 +174,6 @@ describe "About page" doexpect(about_page.site_activities.likes).to have_all_time_periodendend-- describe "traffic info footer" do- it "is displayed when the display_eu_visitor_stats setting is true" do- SiteSetting.display_eu_visitor_stats = true-- about_page.visit-- expect(about_page).to have_traffic_info_footer- end-- it "is not displayed when the display_eu_visitor_stats setting is false" do- SiteSetting.display_eu_visitor_stats = false-- about_page.visit-- expect(about_page).to have_no_traffic_info_footer- end- endenddescribe "our admins section" do@@ -197,7 +181,7 @@ describe "About page" dofab!(:admins) { Fabricate.times(8, :admin) }- it "displays only the 6 most recently seen admins when there are more than 6 admins" do+ it "orders the admins list, expands and collapses it, and opens a user card" doadmins[0].update!(last_seen_at: 4.minutes.ago)admins[1].update!(last_seen_at: 1.minute.ago)admins[2].update!(last_seen_at: 10.minutes.ago)@@ -210,10 +194,6 @@ describe "About page" doexpect(displayed_admins.map { |u| u[:username] }.first(3)).to eq([admins[1].username, admins[0].username, admins[2].username],)- end-- it "allows expanding and collapsing the list of admins" do- about_page.visitdisplayed_admins = about_page.admins_list.usersexpect(displayed_admins.size).to eq(6)@@ -233,6 +213,9 @@ describe "About page" dodisplayed_admins = about_page.admins_list.usersexpect(displayed_admins.size).to eq(6)++ about_page.admins_list.users.first[:node].click+ expect(about_page).to have_css("#user-card")endit "doesn't show an expand/collapse button when there are fewer than 6 admins" do@@ -274,13 +257,6 @@ describe "About page" do*admins.pluck(:name),)end-- it "opens the user card when a user is clicked" do- about_page.visit-- about_page.admins_list.users.first[:node].click- expect(about_page).to have_css("#user-card")- endenddescribe "our moderators section" do@@ -288,7 +264,7 @@ describe "About page" dofab!(:moderators) { Fabricate.times(9, :moderator) }- it "displays only the 6 most recently seen moderators when there are more than 6 moderators" do+ it "orders the moderators list, expands and collapses it, and opens a user card" domoderators[5].update!(last_seen_at: 5.hours.ago)moderators[4].update!(last_seen_at: 2.hours.ago)moderators[1].update!(last_seen_at: 13.hours.ago)@@ -301,10 +277,6 @@ describe "About page" doexpect(displayed_mods.map { |u| u[:username] }.first(3)).to eq([moderators[4].username, moderators[5].username, moderators[1].username],)- end-- it "allows expanding and collapsing the list of moderators" do- about_page.visitdisplayed_mods = about_page.moderators_list.usersexpect(displayed_mods.size).to eq(6)@@ -324,6 +296,9 @@ describe "About page" dodisplayed_mods = about_page.moderators_list.usersexpect(displayed_mods.size).to eq(6)++ about_page.moderators_list.users.last[:node].click+ expect(about_page).to have_css("#user-card")endit "doesn't show an expand/collapse button when there are fewer than 6 moderators" do@@ -365,13 +340,6 @@ describe "About page" do*moderators.pluck(:name),)end-- it "opens the user card when a user is clicked" do- about_page.visit-- about_page.moderators_list.users.last[:node].click- expect(about_page).to have_css("#user-card")- endenddescribe "extra groups" dodiff --git a/spec/system/admin_site_texts_spec.rb b/spec/system/admin_site_texts_spec.rbindex e7a3b7dbbd5..4d292ae9af1 100644--- a/spec/system/admin_site_texts_spec.rb+++ b/spec/system/admin_site_texts_spec.rb@@ -15,8 +15,8 @@ describe "Admin Site Texts Page" doexpect(site_texts_page).to have_translation_key("js.skip_to_main_content")expect(site_texts_page).to have_translation_value(I18n.t("js.skip_to_main_content"))- site_texts_page.visitsite_texts_page.search("js.skip_to_main_content")+ expect(site_texts_page).to have_highlighted_translation_key("js.skip_to_main_content")expect(site_texts_page).to have_translation_key("js.skip_to_main_content")expect(site_texts_page).to have_translation_value(I18n.t("js.skip_to_main_content"))end@@ -27,8 +27,8 @@ describe "Admin Site Texts Page" doexpect(site_texts_page).to have_translation_key("themes.other_error")expect(site_texts_page).to have_translation_value(I18n.t("themes.other_error"))- site_texts_page.visitsite_texts_page.search("themes.other_error")+ expect(site_texts_page).to have_highlighted_translation_key("themes.other_error")expect(site_texts_page).to have_translation_key("themes.other_error")expect(site_texts_page).to have_translation_value(I18n.t("themes.other_error"))end@@ -42,9 +42,8 @@ describe "Admin Site Texts Page" doI18n.t("js.skip_to_main_content", locale: "it"),)- site_texts_page.visit- site_texts_page.select_locale("it")site_texts_page.search("js.skip_to_main_content")+ expect(site_texts_page).to have_highlighted_translation_key("js.skip_to_main_content")expect(site_texts_page).to have_translation_key("js.skip_to_main_content")expect(site_texts_page).to have_translation_value(I18n.t("js.skip_to_main_content", locale: "it"),diff --git a/spec/system/composer/prosemirror_autocomplete_spec.rb b/spec/system/composer/prosemirror_autocomplete_spec.rbindex ca236a23bac..f1b9953fe28 100644--- a/spec/system/composer/prosemirror_autocomplete_spec.rb+++ b/spec/system/composer/prosemirror_autocomplete_spec.rb@@ -3,6 +3,13 @@describe "Composer - ProseMirror - Autocomplete" doinclude_context "with prosemirror editor"+ fab!(:tag)+ fab!(:category_with_emoji) do+ Fabricate(:category, slug: "cat", emoji: "cat", style_type: "emoji")+ end+ fab!(:category_with_icon) { Fabricate(:category, icon: "bell", style_type: "icon") }+ fab!(:category_without_icon, :category)+it "triggers an autocomplete on mention" doopen_composercomposer.type_content("@#{current_user.username}")diff --git a/spec/system/composer/prosemirror_keymap_spec.rb b/spec/system/composer/prosemirror_keymap_spec.rbindex 70b15f68d19..5db0ec56abe 100644--- a/spec/system/composer/prosemirror_keymap_spec.rb+++ b/spec/system/composer/prosemirror_keymap_spec.rb@@ -3,6 +3,10 @@describe "Composer - ProseMirror - Keyboard shortcuts" doinclude_context "with prosemirror editor"+ fab!(:category_with_emoji) do+ Fabricate(:category, slug: "cat", emoji: "cat", style_type: "emoji")+ end+it "supports Ctrl + B to create a bold text" doopen_composercomposer.type_content([SystemHelpers::PLATFORM_KEY_MODIFIER, "b"])diff --git a/spec/system/composer/prosemirror_pasting_spec.rb b/spec/system/composer/prosemirror_pasting_spec.rbindex e04797184ba..109fc767a45 100644--- a/spec/system/composer/prosemirror_pasting_spec.rb+++ b/spec/system/composer/prosemirror_pasting_spec.rb@@ -316,7 +316,7 @@ describe "Composer - ProseMirror - Pasting content" doendcontext "when pasting tables" do- it "fills incomplete rows" do+ it "normalizes pasted tables and handles empty rows" docdp.allow_clipboardopen_composer@@ -347,11 +347,9 @@ describe "Composer - ProseMirror - Pasting content" doMARKDOWNexpect(composer).to have_value(markdown)- end-- it "normalizes column counts when header has fewer columns than body rows" do- cdp.allow_clipboard- open_composer+ composer.clear_content+ composer.toggle_rich_editor+ composer.focushtml = <<~HTML<table>@@ -376,11 +374,9 @@ describe "Composer - ProseMirror - Pasting content" doMARKDOWNexpect(composer).to have_value(markdown)- end-- it "normalizes nested table column counts" do- cdp.allow_clipboard- open_composer+ composer.clear_content+ composer.toggle_rich_editor+ composer.focushtml = <<~HTML<table>@@ -421,11 +417,9 @@ describe "Composer - ProseMirror - Pasting content" doMARKDOWNexpect(composer).to have_value(markdown)- end-- it "handles tables with empty rows without crashing" do- cdp.allow_clipboard- open_composer+ composer.clear_content+ composer.toggle_rich_editor+ composer.focushtml = <<~HTML<table>diff --git a/spec/system/content_localization_spec.rb b/spec/system/content_localization_spec.rbindex ab255b064a9..a5d97d31d56 100644--- a/spec/system/content_localization_spec.rb+++ b/spec/system/content_localization_spec.rb@@ -492,6 +492,7 @@ describe "Content Localization" doFabricate(:post,topic: topic,+ user: admin,locale: "ja",raw: "Japanese content for post #{post_number}",cooked: "<p>日本語コンテンツ #{post_number}</p>",@@ -540,12 +541,19 @@ describe "Content Localization" doFabricate(:post,topic: late_localization_topic,+ user: admin,locale: "en",raw: "English post #{index + 1}",)endlate_post =- Fabricate(:post, topic: late_localization_topic, locale: "ja", raw: "最初のページより後の投稿")+ Fabricate(+ :post,+ topic: late_localization_topic,+ user: admin,+ locale: "ja",+ raw: "最初のページより後の投稿",+ )Fabricate(:post_localization,post: late_post,diff --git a/spec/system/custom_sidebar_sections_spec.rb b/spec/system/custom_sidebar_sections_spec.rbindex 05bd480b330..81106ced4e3 100644--- a/spec/system/custom_sidebar_sections_spec.rb+++ b/spec/system/custom_sidebar_sections_spec.rb@@ -38,145 +38,130 @@ describe "Custom sidebar sections" doinclude_examples "creating custom sections"- it "allows the user to create custom section with /my link" do+ it "allows the user to create sections with different link formats" dosign_in uservisit("/latest")sidebar.click_add_section_button- section_modal.fill_name("My section")+ section_modal.fill_name("Preferences section")section_modal.fill_link("My preferences", "/my/preferences")section_modal.save- expect(sidebar).to have_section("My section")+ expect(section_modal).to be_closed+ expect(sidebar).to have_section("Preferences section")expect(sidebar).to have_section_link("My preferences", target: "_self")- end-- it "prioritizes exact url matches over ember routes" do- sidebar_section = SidebarSection.find_by(section_type: "community")- sidebar_url = Fabricate(:sidebar_url, name: "Topics", value: "/latest")- sidebar_url_2 =- Fabricate(:sidebar_url, name: "Sorted latest", value: "/latest?ascending=true&order=posts")- Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url)- Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url_2)-- sign_in user-- visit("/latest?ascending=true&order=posts")- expect(sidebar).to have_exact_url_match_link("Sorted latest")- expect(sidebar).to have_no_active_links- expect(sidebar).to have_no_exact_url_match_link("everything")-- visit("/latest")- expect(sidebar).to have_active_link("everything")- expect(sidebar).to have_no_exact_url_match_link("Sorted latest")- end-- it "allows the user to create custom section with `/` path" do- SiteSetting.top_menu = "read|posted|latest"-- sign_in user- visit("/latest")sidebar.click_add_section_button- section_modal.fill_name("My section")- section_modal.fill_link("Home", "/")- section_modal.save-- expect(sidebar).to have_section("My section")- expect(sidebar).to have_section_link("Home", href: "/")-- sidebar.click_section_link("Home")- expect(page).to have_css("#navigation-bar .active a[href='/read']")- end-- it "allows the user to create custom section with /pub link" do- sign_in user- visit("/latest")-- sidebar.click_add_section_button- section_modal.fill_name("My section")+ section_modal.fill_name("Published page section")section_modal.fill_link("Published Page", "/pub/test")section_modal.save- expect(sidebar).to have_section("My section")+ expect(section_modal).to be_closed+ expect(sidebar).to have_section("Published page section")expect(sidebar).to have_section_link("Published Page", target: "_self")- end- it "allows the user to create custom section with external link" do- sign_in user- visit("/latest")sidebar.click_add_section_buttonexpect(section_modal).to be_visibleexpect(section_modal).to have_disabled_saveexpect(sidebar.custom_section_modal_title).to have_content("Add custom section")- section_modal.fill_name("My section")+ section_modal.fill_name("External link section")section_modal.fill_link("Discourse Homepage", "https://discourse.org")expect(section_modal).to have_enabled_savesection_modal.save- expect(sidebar).to have_section("My section")+ expect(section_modal).to be_closed+ expect(sidebar).to have_section("External link section")expect(sidebar).to have_section_link("Discourse Homepage",href: "https://discourse.org",target: "_blank",)- end- it "allows the user to create custom section with anchor" do- sign_in user- visit("/latest")sidebar.click_add_section_buttonexpect(section_modal).to be_visibleexpect(section_modal).to have_disabled_saveexpect(sidebar.custom_section_modal_title).to have_content("Add custom section")- section_modal.fill_name("My section")+ section_modal.fill_name("Anchor section")section_modal.fill_link("Faq", "/faq#anchor")section_modal.save- expect(sidebar).to have_section("My section")+ expect(section_modal).to be_closed+ expect(sidebar).to have_section("Anchor section")expect(sidebar).to have_section_link("Faq", target: "_self", href: "/faq#anchor")- end- it "allows the user to create custom section with query param" do- sign_in user- visit("/latest")sidebar.click_add_section_buttonexpect(section_modal).to be_visibleexpect(section_modal).to have_disabled_saveexpect(sidebar.custom_section_modal_title).to have_content("Add custom section")- section_modal.fill_name("My section")+ section_modal.fill_name("Query section")section_modal.fill_link("Faq", "/faq?a=b")section_modal.save- expect(sidebar).to have_section("My section")+ expect(section_modal).to be_closed+ expect(sidebar).to have_section("Query section")expect(sidebar).to have_section_link("Faq", target: "_self", href: "/faq?a=b")- end- it "allows the user to create custom section with anchor link" do- sign_in user- visit("/latest")sidebar.click_add_section_buttonexpect(section_modal).to be_visibleexpect(section_modal).to have_disabled_saveexpect(sidebar.custom_section_modal_title).to have_content("Add custom section")- section_modal.fill_name("My section")+ section_modal.fill_name("Heading section")section_modal.fill_link("Faq", "/faq#someheading")section_modal.save- expect(sidebar).to have_section("My section")+ expect(section_modal).to be_closed+ expect(sidebar).to have_section("Heading section")expect(sidebar).to have_section_link("Faq", target: "_self", href: "/faq#someheading")end+ it "prioritizes exact url matches over ember routes" do+ sidebar_section = SidebarSection.find_by(section_type: "community")+ sidebar_url = Fabricate(:sidebar_url, name: "Topics", value: "/latest")+ sidebar_url_2 =+ Fabricate(:sidebar_url, name: "Sorted latest", value: "/latest?ascending=true&order=posts")+ Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url)+ Fabricate(:sidebar_section_link, sidebar_section: sidebar_section, linkable: sidebar_url_2)++ sign_in user++ visit("/latest?ascending=true&order=posts")+ expect(sidebar).to have_exact_url_match_link("Sorted latest")+ expect(sidebar).to have_no_active_links+ expect(sidebar).to have_no_exact_url_match_link("everything")++ visit("/latest")+ expect(sidebar).to have_active_link("everything")+ expect(sidebar).to have_no_exact_url_match_link("Sorted latest")+ end++ it "allows the user to create custom section with `/` path" do+ SiteSetting.top_menu = "read|posted|latest"++ sign_in user+ visit("/latest")++ sidebar.click_add_section_button+ section_modal.fill_name("My section")+ section_modal.fill_link("Home", "/")+ section_modal.save++ expect(sidebar).to have_section("My section")+ expect(sidebar).to have_section_link("Home", href: "/")++ sidebar.click_section_link("Home")+ expect(page).to have_css("#navigation-bar .active a[href='/read']")+ end+it "allows typing in the icon picker filter input" dosign_in uservisit("/latest")diff --git a/spec/system/lightbox_spec.rb b/spec/system/lightbox_spec.rbindex c357deb93a4..499d6d9fe27 100644--- a/spec/system/lightbox_spec.rb+++ b/spec/system/lightbox_spec.rb@@ -25,10 +25,15 @@ describe "Lightbox | Photoswipe" dopost.update(cooked: cpp.html)end- it "has the correct lightbox elements" do+ it "lets the user inspect a single image and quote it into the composer" dotopic_page.visit_topic(topic)- topic_page.post_by_number(1).find("a.lightbox").click+ lightbox_link = topic_page.post_by_number(1).find("a.lightbox")+ lightbox_image = lightbox_link.find("img", visible: :all)+ expected_width = lightbox_link["data-target-width"].presence || lightbox_image["width"]+ expected_height = lightbox_link["data-target-height"].presence || lightbox_image["height"]+ expected_src = lightbox_image["data-orig-src"].presence || lightbox_link["href"]+ lightbox_link.clickexpect(lightbox).to be_visible@@ -41,17 +46,14 @@ describe "Lightbox | Photoswipe" doexpect(lightbox).to have_download_buttonexpect(lightbox).to have_original_image_buttonexpect(lightbox).to have_image_info_button- end- it "quotes the image into the composer" do- topic_page.visit_topic(topic)+ lightbox.image_info_button.click- lightbox_link = topic_page.post_by_number(1).find("a.lightbox")- lightbox_image = lightbox_link.find("img", visible: :all)- expected_width = lightbox_link["data-target-width"].presence || lightbox_image["width"]- expected_height = lightbox_link["data-target-height"].presence || lightbox_image["height"]- expected_src = lightbox_image["data-orig-src"].presence || lightbox_link["href"]- lightbox_link.click+ expect(lightbox).to have_caption_details("2400×3600 1.21 KB")++ lightbox.image_info_button.click++ expect(lightbox).to have_no_caption_detailsexpect(lightbox).to have_quote_button@@ -73,23 +75,6 @@ describe "Lightbox | Photoswipe" doexpect(lightbox).to have_no_image_info_buttonend-- it "can toggle image info" do- topic_page.visit_topic(topic)-- topic_page.post_by_number(1).find("a.lightbox").click-- expect(lightbox).to be_visible- expect(lightbox).to have_no_caption_details-- lightbox.image_info_button.click-- expect(lightbox).to have_caption_details("2400×3600 1.21 KB")-- lightbox.image_info_button.click-- expect(lightbox).to have_no_caption_details- endendcontext "with multiple images" do@@ -192,7 +177,7 @@ describe "Lightbox | Photoswipe" dopost.update(cooked: cpp.html)end- it "toggles UI by tapping image" do+ it "lets the user toggle image controls and information before closing the lightbox" dotopic_page.visit_topic(topic)topic_page.post_by_number(1).find("a.lightbox").click@@ -204,23 +189,6 @@ describe "Lightbox | Photoswipe" dotap_screen_at(screen_center_x, screen_center_y)expect(lightbox).to have_ui_visible- end-- it "closes lightbox by tapping backdrop" do- topic_page.visit_topic(topic)- topic_page.post_by_number(1).find("a.lightbox").click-- expect(lightbox).to be_visible-- tap_screen_at(50, 50)-- expect(lightbox).to be_hidden- end-- it "toggles image info by clicking button" do- topic_page.visit_topic(topic)-- topic_page.post_by_number(1).find("a.lightbox").clickexpect(lightbox).to be_visibleexpect(lightbox).to have_no_caption_details@@ -232,6 +200,12 @@ describe "Lightbox | Photoswipe" dolightbox.image_info_button.clickexpect(lightbox).to have_no_caption_details++ expect(lightbox).to be_visible++ tap_screen_at(50, 50)++ expect(lightbox).to be_hiddenendenddiff --git a/spec/system/login_spec.rb b/spec/system/login_spec.rbindex 016a0740d53..265b6aea05b 100644--- a/spec/system/login_spec.rb+++ b/spec/system/login_spec.rb@@ -131,12 +131,15 @@ shared_examples "login scenarios" docontext "when login is required" dobefore { SiteSetting.login_required = true }- it "cannot browse annonymously" do+ it "keeps topics private until the user logs in" dovisit "/"screenshot_marker(label: "login-required")expect(page).to have_css(".login-welcome")expect(page).to have_css(".site-logo")+ expect(page.body).not_to include(topic.title)+ expect(page.body).not_to include(topic2.title)+find(".login-welcome .login-button").clickscreenshot_marker(label: "login-form")@@ -174,15 +177,6 @@ shared_examples "login scenarios" doexpect(page).to have_current_path("/new-topic?category_id=#{category.id}")end- it "does not leak topics" do- visit "/"-- expect(page).to have_css(".login-welcome")-- expect(page.body).not_to include(topic.title)- expect(page.body).not_to include(topic2.title)- end-it "does not leak category metadata if homepage is /categories" doSiteSetting.top_menu = "categories|latest|new|top"visit "/"@@ -417,22 +411,7 @@ shared_examples "login scenarios" doexpect(reset_password_page).to have_logged_in_userend- it "can reset password with TOTP" do- login_form.open.fill_username("john").forgot_password- find("button.forgot-password-reset").click-- reset_password_link = wait_for_email_link(user, :reset_password)- visit reset_password_link- totp = ROTP::TOTP.new(user_second_factor.data).now- find(".second-factor-token-input").fill_in(with: totp)- find(".password-reset .btn-primary").click- find("#new-account-password").fill_in(with: "newsuperpassword")- find(".change-password-form .btn-primary").click-- expect(page).to have_css(".header-dropdown-toggle.current-user")- end-- it "shows error correctly when TOTP code is invalid" do+ it "lets the user retry an invalid TOTP code and reset their password" dologin_form.open.fill_username("john").forgot_passwordfind("button.forgot-password-reset").click@@ -446,6 +425,14 @@ shared_examples "login scenarios" dotext: "Invalid authentication code. Each code can only be used once.",)expect(page).to have_css(".second-factor-token-input")++ totp = ROTP::TOTP.new(user_second_factor.data).now+ find(".second-factor-token-input").fill_in(with: totp)+ find(".password-reset .btn-primary").click+ find("#new-account-password").fill_in(with: "newsuperpassword")+ find(".change-password-form .btn-primary").click++ expect(page).to have_css(".header-dropdown-toggle.current-user")endit "can reset password with a backup code" dodiff --git a/spec/system/page_objects/cdp.rb b/spec/system/page_objects/cdp.rbindex 27008e4e6be..f132ddc60fe 100644--- a/spec/system/page_objects/cdp.rb+++ b/spec/system/page_objects/cdp.rb@@ -162,7 +162,7 @@ module PageObjects"Network.emulateNetworkConditions",params: {offline: false,- latency: 20_000,+ latency: 0,downloadThroughput: -1,uploadThroughput: 1,},diff --git a/spec/system/page_objects/components/logo.rb b/spec/system/page_objects/components/logo.rbindex d64ed75bd9d..518bbd8891c 100644--- a/spec/system/page_objects/components/logo.rb+++ b/spec/system/page_objects/components/logo.rb@@ -6,7 +6,7 @@ module PageObjectsSELECTOR = "#site-logo"def click- find(SELECTOR).click+ find(".d-header .title a").clickenddef hoverdiff --git a/spec/system/page_objects/components/topic_list.rb b/spec/system/page_objects/components/topic_list.rbindex 90a7266fb87..211008429da 100644--- a/spec/system/page_objects/components/topic_list.rb+++ b/spec/system/page_objects/components/topic_list.rb@@ -90,6 +90,10 @@ module PageObjectsfind("#{topic_list_item_class(topic)} a.raw-topic-link").clickend+ def scroll_to_topic_at_index(index)+ page.scroll_to(all(TOPIC_LIST_ITEM_SELECTOR)[index], align: :top)+ end+def scroll_page_down(amount: 50)page.execute_script(<<~JS, amount)const listArea = document.querySelector("#list-area");diff --git a/spec/system/page_objects/pages/admin_site_texts.rb b/spec/system/page_objects/pages/admin_site_texts.rbindex ba0ea0a8af2..241438cafcf 100644--- a/spec/system/page_objects/pages/admin_site_texts.rb+++ b/spec/system/page_objects/pages/admin_site_texts.rb@@ -17,6 +17,10 @@ module PageObjectshas_css?(".site-text-id", text: key)end+ def has_highlighted_translation_key?(key)+ has_css?(".site-text-id .text-highlight", text: key, exact_text: true)+ end+def has_translation_value?(value)has_css?(".site-text-value", text: value)enddiff --git a/spec/system/post_menu_spec.rb b/spec/system/post_menu_spec.rbindex 3e9ae9dd13d..95c3f914630 100644--- a/spec/system/post_menu_spec.rb+++ b/spec/system/post_menu_spec.rb@@ -165,11 +165,6 @@ describe "Post menu" dodescribe "bookmark" dobefore { SiteSetting.post_menu_hidden_items = "" }- it "does not display the bookmark button when the user is anonymous" do- topic_page.visit_topic(post.topic)- expect(topic_page).to have_no_post_action_button(post, :bookmark)- end-it "works as expected" dosign_in(user)@@ -200,16 +195,21 @@ describe "Post menu" doendend- describe "delete / recover" do+ describe "action visibility" dobefore { SiteSetting.post_menu_hidden_items = "" }- it "displays the delete button only when the user can delete the post" do+ it "shows post action buttons according to the user's permissions" do# do not display the edit button when unloggedtopic_page.visit_topic(post.topic)expect(topic_page).to have_no_post_action_button(post, :delete)expect(topic_page).to have_no_post_action_button(post2, :delete)+ # do not display the edit button when unlogged+ expect(topic_page).to have_no_post_action_button(post, :flag)+ expect(topic_page).to have_no_post_action_button(post2, :flag)+ expect(topic_page).to have_no_post_action_button(post, :bookmark)+# display the delete button only for the post that `user` can deletesign_in(user)@@ -218,6 +218,10 @@ describe "Post menu" doexpect(topic_page).to have_no_post_action_button(post, :delete)expect(topic_page).to have_post_action_button(post2, :delete)+ # display the flag button only for the post that `user` can flag+ expect(topic_page).to have_post_action_button(post, :flag)+ expect(topic_page).to have_post_action_button(post2, :flag)+# display the delete button for the all the posts because an admin is loggedsign_in(admin)@@ -225,7 +229,15 @@ describe "Post menu" doexpect(topic_page).to have_post_action_button(post, :delete)expect(topic_page).to have_post_action_button(post2, :delete)++ # display the flag button for the all the posts because an admin is logged+ expect(topic_page).to have_post_action_button(post, :flag)+ expect(topic_page).to have_post_action_button(post2, :flag)end+ end++ describe "delete / recover" do+ before { SiteSetting.post_menu_hidden_items = "" }it "displays the recover button only when the user can recover the post" doPostDestroyer.new(user, post2).destroy@@ -414,30 +426,6 @@ describe "Post menu" dodescribe "flag" dobefore { SiteSetting.post_menu_hidden_items = "" }- it "displays the flag button only when the user can flag the post" do- # do not display the edit button when unlogged- topic_page.visit_topic(post.topic)-- expect(topic_page).to have_no_post_action_button(post, :flag)- expect(topic_page).to have_no_post_action_button(post2, :flag)-- # display the flag button only for the post that `user` can flag- sign_in(user)-- topic_page.visit_topic(post.topic)-- expect(topic_page).to have_post_action_button(post, :flag)- expect(topic_page).to have_post_action_button(post2, :flag)-- # display the flag button for the all the posts because an admin is logged- sign_in(admin)-- topic_page.visit_topic(post.topic)-- expect(topic_page).to have_post_action_button(post, :flag)- expect(topic_page).to have_post_action_button(post2, :flag)- end-it "works as expected" dosign_in(user)diff --git a/spec/system/scroll_manager_service_spec.rb b/spec/system/scroll_manager_service_spec.rbindex 7bcf3fee132..1e74b55080c 100644--- a/spec/system/scroll_manager_service_spec.rb+++ b/spec/system/scroll_manager_service_spec.rb@@ -20,14 +20,12 @@ describe "Ember route-scroll-manager service" doexpect(page).to have_css("body.navigation-topics")expect(discovery.topic_list).to have_topics- page.execute_script <<~JS- document.querySelectorAll('.topic-list-item')[10].scrollIntoView(true);- JS+ discovery.topic_list.scroll_to_topic_at_index(10)topic_list_scroll_y = current_scroll_yexpect(topic_list_scroll_y).to be > 0- find(".sidebar-section-link[data-link-name='all-categories']").click+ find(".sidebar-section-link[data-link-name='all-categories']").send_keys(:enter)expect(page).to have_css("body.navigation-categories")expect(current_scroll_y).to eq(0)@@ -47,7 +45,7 @@ describe "Ember route-scroll-manager service" dovisit("/t/#{topic.slug}/#{topic.id}")expect(page).to have_css("#post_20")- page.execute_script("window.scrollTo(0, document.body.scrollHeight)")+ page.scroll_to(:bottom)expect(current_scroll_y).to be > 0click_logodiff --git a/spec/system/signup_spec.rb b/spec/system/signup_spec.rbindex e08b081b5c2..0cd9651d781 100644--- a/spec/system/signup_spec.rb+++ b/spec/system/signup_spec.rb@@ -16,7 +16,7 @@ shared_examples "signup scenarios" docontext "when anyone can create an account" dobefore { Jobs.run_immediately! }- it "can signup" do+ it "can sign up, activate the account, and access 2FA preferences" dosignup_page.open.fill_email(invite.email)@@ -26,19 +26,6 @@ shared_examples "signup scenarios" doscreenshot_marker(label: "signup")- signup_page.click_create_account-- expect(page).to have_current_path("/u/account-created")- end-- it "can signup and activate account" do- signup_page- .open- .fill_email(invite.email)- .fill_username("john")- .fill_password("supersecurepassword")- expect(signup_page).to have_valid_fields-signup_page.click_create_accountexpect(page).to have_current_path("/u/account-created")@@ -55,29 +42,6 @@ shared_examples "signup scenarios" doexpect(page).to have_current_path("/")expect(page).to have_css(".header-dropdown-toggle.current-user")- end-- it "can access 2FA preferences screen after signing up and activating account" do- signup_page- .open- .fill_email(invite.email)- .fill_username("john")- .fill_password("supersecurepassword")- expect(signup_page).to have_valid_fields-- signup_page.click_create_account- expect(page).to have_current_path("/u/account-created")-- mail = ActionMailer::Base.deliveries.first- expect(mail.to).to contain_exactly(invite.email)- activation_link = mail.body.to_s[%r{/u/activate-account/\S+}]-- visit activation_link-- activate_account.click_activate_account- activate_account.click_continue-- expect(page).to have_css(".header-dropdown-toggle.current-user")visit "/u/john/preferences/security"diff --git a/spec/system/social_authentication_spec.rb b/spec/system/social_authentication_spec.rbindex d55ccead8e5..8f75038b1f4 100644--- a/spec/system/social_authentication_spec.rb+++ b/spec/system/social_authentication_spec.rb@@ -19,8 +19,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_facebook_auth- visit("/")-signup_page.open.click_social_button("facebook")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -39,8 +37,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_google_auth- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -55,8 +51,6 @@ shared_examples "social authentication scenarios" docontext "when the email is not verified" doit "needs to verify email" domock_google_auth(verified: false)- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -76,8 +70,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_github_auth- visit("/")-signup_page.open.click_social_button("github")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -91,8 +83,6 @@ shared_examples "social authentication scenarios" docontext "when the email is not verified" doit "needs to verify email" domock_github_auth(verified: false)- visit("/")-signup_page.open.click_social_button("github")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -112,8 +102,6 @@ shared_examples "social authentication scenarios" doit "lets user input Name when no name is provided" domock_github_auth(name: "")- visit("/")-signup_page.open.click_social_button("github")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -130,8 +118,6 @@ shared_examples "social authentication scenarios" doit "works with a provided name" domock_github_auth(name: "Some Name")- visit("/")-signup_page.open.click_social_button("github")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -151,8 +137,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_twitter_auth- visit("/")-signup_page.open.click_social_button("twitter")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -167,8 +151,6 @@ shared_examples "social authentication scenarios" docontext "when the email is not verified" doit "needs to verify email" domock_twitter_auth(verified: false)- visit("/")-signup_page.open.click_social_button("twitter")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -187,8 +169,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_discord_auth- visit("/")-signup_page.open.click_social_button("discord")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -207,8 +187,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_linkedin_auth- visit("/")-signup_page.open.click_social_button("linkedin_oidc")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -227,8 +205,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form" domock_google_auth- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -251,8 +227,6 @@ shared_examples "social authentication scenarios" doit "fills the signup form and disables the inputs" domock_google_auth- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -276,8 +250,6 @@ shared_examples "social authentication scenarios" doit "creates the account directly" domock_google_auth- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(page).to have_css(".header-dropdown-toggle.current-user")end@@ -285,8 +257,6 @@ shared_examples "social authentication scenarios" doit "shows signup form when no username can be derived" doSiteSetting.use_email_for_username_and_name_suggestions = falsemock_google_auth(name: "")- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(signup_page).to be_openexpect(signup_page).to have_no_password_input@@ -443,8 +413,6 @@ shared_examples "social authentication scenarios" doit "logs in user" domock_facebook_auth- visit("/")-signup_page.open.click_social_button("facebook")expect(page).to have_css(".header-dropdown-toggle.current-user")end@@ -488,8 +456,6 @@ shared_examples "social authentication scenarios" doit "shows suspended message" domock_facebook_auth- visit("/")-signup_page.open.click_social_button("facebook")expect(page).to have_css(@@ -506,8 +472,6 @@ shared_examples "social authentication scenarios" doit "logs in user" domock_google_auth- visit("/")-signup_page.open.click_social_button("google_oauth2")expect(page).to have_css(".header-dropdown-toggle.current-user")end@@ -519,8 +483,6 @@ shared_examples "social authentication scenarios" doit "logs in user" domock_github_auth- visit("/")-signup_page.open.click_social_button("github")expect(page).to have_css(".header-dropdown-toggle.current-user")end@@ -538,8 +500,6 @@ shared_examples "social authentication scenarios" do)mock_twitter_auth- visit("/")-signup_page.open.click_social_button("twitter")expect(page).to have_css(".header-dropdown-toggle.current-user")end@@ -551,8 +511,6 @@ shared_examples "social authentication scenarios" doit "logs in user" domock_discord_auth- visit("/")-signup_page.open.click_social_button("discord")expect(page).to have_css(".header-dropdown-toggle.current-user")end@@ -565,8 +523,6 @@ shared_examples "social authentication scenarios" doit "logs in user" domock_linkedin_auth- visit("/")-signup_page.open.click_social_button("linkedin_oidc")expect(page).to have_css(".header-dropdown-toggle.current-user")enddiff --git a/spec/system/unified_new_topic_list_spec.rb b/spec/system/unified_new_topic_list_spec.rbindex 6beb9af944a..e3643e925df 100644--- a/spec/system/unified_new_topic_list_spec.rb+++ b/spec/system/unified_new_topic_list_spec.rb@@ -34,7 +34,7 @@ describe "Unified new topic list" docontext "when unified new is enabled" dobefore { SiteSetting.enable_unified_new = true }- it "shows all new topics and replies by default" do+ it "lets the user switch between all new topics, topics, and replies" dovisit("/new")expect(topic_list).to have_topics(count: 6)@@ -53,24 +53,7 @@ describe "Unified new topic list" doexpect(tabs_toggle.all_tab).to be_activeexpect(tabs_toggle.replies_tab).to be_inactiveexpect(tabs_toggle.topics_tab).to be_inactive- end-- it "respects the subset query param and activates the appropriate tab" do- visit("/new?subset=topics")-- expect(tabs_toggle.all_tab).to be_inactive- expect(tabs_toggle.replies_tab).to be_inactive- expect(tabs_toggle.topics_tab).to be_active-- visit("/new?subset=replies")-- expect(tabs_toggle.all_tab).to be_inactive- expect(tabs_toggle.replies_tab).to be_active- expect(tabs_toggle.topics_tab).to be_inactive- end- it "shows only new topics when the user switches to the Topics tab" do- visit("/new")tabs_toggle.topics_tab.clickexpect(topic_list).to have_topics(count: 3)@@ -86,10 +69,12 @@ describe "Unified new topic list" doexpect(tabs_toggle.topics_tab).to have_count(3)expect(page).to have_current_path("/new?subset=topics")- end- it "shows only topics with new replies when the user switches to the Replies tab" do- visit("/new")+ tabs_toggle.all_tab.click++ expect(tabs_toggle.all_tab).to be_active+ expect(topic_list).to have_topics(count: 6)+tabs_toggle.replies_tab.clickexpect(topic_list).to have_topics(count: 3)@@ -107,6 +92,20 @@ describe "Unified new topic list" doexpect(page).to have_current_path("/new?subset=replies")end+ it "respects the subset query param and activates the appropriate tab" do+ visit("/new?subset=topics")++ expect(tabs_toggle.all_tab).to be_inactive+ expect(tabs_toggle.replies_tab).to be_inactive+ expect(tabs_toggle.topics_tab).to be_active++ visit("/new?subset=replies")++ expect(tabs_toggle.all_tab).to be_inactive+ expect(tabs_toggle.replies_tab).to be_active+ expect(tabs_toggle.topics_tab).to be_inactive+ end+it "strips out the subset query params when switching back to the All tab from any of the other tabs" dovisit("/new")tabs_toggle.replies_tab.click@@ -141,7 +140,7 @@ describe "Unified new topic list" doendcontext "when the /new topic list is scoped to a category" do- it "shows new topics and replies in the category" do+ it "lets the user switch between new topics and replies in the category" dovisit("/c/#{category.slug}/#{category.id}/l/new")expect(topic_list).to have_topics(count: 2)expect(topic_list).to have_topic(new_reply_in_category)@@ -153,10 +152,7 @@ describe "Unified new topic list" doexpect(tabs_toggle.replies_tab).to have_count(1)expect(tabs_toggle.topics_tab).to have_count(1)- end- it "shows only new topics in the category when the user switches to the Topics tab" do- visit("/c/#{category.slug}/#{category.id}/l/new")tabs_toggle.topics_tab.clickexpect(topic_list).to have_topics(count: 1)@@ -172,10 +168,12 @@ describe "Unified new topic list" doexpect(page).to have_current_path("/c/#{category.slug}/#{category.id}/l/new?subset=topics",)- end- it "shows only topics with new replies in the category when the user switches to the Replies tab" do- visit("/c/#{category.slug}/#{category.id}/l/new")+ tabs_toggle.all_tab.click++ expect(tabs_toggle.all_tab).to be_active+ expect(topic_list).to have_topics(count: 2)+tabs_toggle.replies_tab.clickexpect(topic_list).to have_topics(count: 1)@@ -223,7 +221,7 @@ describe "Unified new topic list" doendcontext "when the /new topic list is scoped to a tag" do- it "shows new topics and replies with the tag" do+ it "lets the user switch between new topics and replies with the tag" dovisit("/tag/#{tag.slug}/#{tag.id}/l/new")expect(topic_list).to have_topics(count: 2)[new_reply_with_tag, new_topic_with_tag].each do |topic|@@ -236,10 +234,7 @@ describe "Unified new topic list" doexpect(tabs_toggle.replies_tab).to have_count(1)expect(tabs_toggle.topics_tab).to have_count(1)- end- it "shows only new topics with the tag when the user switches to the Topics tab" do- visit("/tag/#{tag.slug}/#{tag.id}/l/new")tabs_toggle.topics_tab.clickexpect(topic_list).to have_topics(count: 1)@@ -253,10 +248,11 @@ describe "Unified new topic list" doexpect(tabs_toggle.topics_tab).to have_count(1)expect(page).to have_current_path("/tag/#{tag.slug}/#{tag.id}/l/new?subset=topics")- end- it "shows only topics with new replies with the tag when the user switches to the Replies tab" do- visit("/tag/#{tag.slug}/#{tag.id}/l/new")+ tabs_toggle.all_tab.click++ expect(tabs_toggle.all_tab).to be_active+ expect(topic_list).to have_topics(count: 2)tabs_toggle.replies_tab.clickdiff --git a/spec/system/user_page/user_preferences_profile_spec.rb b/spec/system/user_page/user_preferences_profile_spec.rbindex d2b57af9d01..e9c3e22ea53 100644--- a/spec/system/user_page/user_preferences_profile_spec.rb+++ b/spec/system/user_page/user_preferences_profile_spec.rb@@ -10,7 +10,10 @@ describe "User preferences | Profile" dodescribe "changing bio" doit "correctly updates the bio" do+ user.user_option.update!(timezone: nil)+user_preferences_profile_page.visit(user)+ expect(user.user_option.reload.timezone).to be_presentuser_preferences_profile_page.expand_profile_detailsuser_preferences_profile_page.fill_bio(with: "I am a human.")