From 9194197de580242e7572aa00b7c07bff6170cf7e Mon Sep 17 00:00:00 2001 From: Michael Stanclift Date: Wed, 14 Aug 2024 14:23:45 -0500 Subject: [PATCH 1/3] Modify profile directory page image borders (#31391) --- app/javascript/styles/mastodon/components.scss | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/javascript/styles/mastodon/components.scss b/app/javascript/styles/mastodon/components.scss index 8373cad0ce..08f43c59cb 100644 --- a/app/javascript/styles/mastodon/components.scss +++ b/app/javascript/styles/mastodon/components.scss @@ -7372,9 +7372,18 @@ a.status-card { } .scrollable .account-card__title__avatar { - img, + img { + border: 2px solid var(--background-color); + } + .account__avatar { - border-color: lighten($ui-base-color, 8%); + border: none; + } +} + +.scrollable .account-card__header { + img { + border-radius: 4px; } } From 4545b8d6cbab59591135ce8d0dfc75ad84c46e73 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Thu, 15 Aug 2024 08:44:13 +0200 Subject: [PATCH 2/3] Add the ability to ignore specific browser errors for a spec (#31436) --- ...javascript_errors.rb => browser_errors.rb} | 19 ++++++++++++++++--- spec/system/log_out_spec.rb | 3 +++ 2 files changed, 19 insertions(+), 3 deletions(-) rename spec/support/{javascript_errors.rb => browser_errors.rb} (66%) diff --git a/spec/support/javascript_errors.rb b/spec/support/browser_errors.rb similarity index 66% rename from spec/support/javascript_errors.rb rename to spec/support/browser_errors.rb index ef5945f37d..8a31ba3ab6 100644 --- a/spec/support/javascript_errors.rb +++ b/spec/support/browser_errors.rb @@ -1,23 +1,36 @@ # frozen_string_literal: true +module BrowserErrorsHelpers + def ignore_js_error(error) + @ignored_js_errors_for_spec << error + end +end + RSpec.configure do |config| + config.include BrowserErrorsHelpers, :js, type: :system + + config.before(:each, :js, type: :system) do + @ignored_js_errors_for_spec = [] + end + config.after(:each, :js, type: :system) do # Classes of intermittent ignorable errors ignored_errors = [ /Error while trying to use the following icon from the Manifest/, # https://github.com/mastodon/mastodon/pull/30793 /Manifest: Line: 1, column: 1, Syntax error/, # Similar parsing/interruption issue as above - ] + ].concat(@ignored_js_errors_for_spec) + errors = page.driver.browser.logs.get(:browser).reject do |error| ignored_errors.any? { |pattern| pattern.match(error.message) } end if errors.present? - aggregate_failures 'javascript errrors' do + aggregate_failures 'browser errrors' do errors.each do |error| expect(error.level).to_not eq('SEVERE'), error.message next unless error.level == 'WARNING' - warn 'WARN: javascript warning' + warn 'WARN: browser warning' warn error.message end end diff --git a/spec/system/log_out_spec.rb b/spec/system/log_out_spec.rb index 376f19712e..f50f7c2d18 100644 --- a/spec/system/log_out_spec.rb +++ b/spec/system/log_out_spec.rb @@ -24,6 +24,9 @@ describe 'Log out' do describe 'Logging out from the JS app', :js, :streaming do it 'logs the user out' do + # The frontend tries to load announcements after a short delay, but the session might be expired by then, and the browser will output an error. + ignore_js_error(/Failed to load resource: the server responded with a status of 422/) + visit root_path within '.navigation-bar' do From 5d04e297755c4a8b4e908f706d272520521341d4 Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Thu, 15 Aug 2024 08:45:00 +0200 Subject: [PATCH 3/3] Disable Chrome's search engine selection screen when running system specs (#31437) --- spec/support/capybara.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/spec/support/capybara.rb b/spec/support/capybara.rb index be1378ffac..4357d51382 100644 --- a/spec/support/capybara.rb +++ b/spec/support/capybara.rb @@ -6,14 +6,20 @@ Capybara.app_host = "http://#{Capybara.server_host}:#{Capybara.server_port}" require 'selenium/webdriver' +def common_chrome_options + options = Selenium::WebDriver::Chrome::Options.new + options.add_argument '--window-size=1680,1050' + options.add_argument '--disable-search-engine-choice-screen' + options +end + Capybara.register_driver :chrome do |app| - Capybara::Selenium::Driver.new(app, browser: :chrome) + Capybara::Selenium::Driver.new(app, browser: :chrome, options: common_chrome_options) end Capybara.register_driver :headless_chrome do |app| - options = Selenium::WebDriver::Chrome::Options.new + options = common_chrome_options options.add_argument '--headless=new' - options.add_argument '--window-size=1680,1050' Capybara::Selenium::Driver.new( app,