Skip to content

Commit

Permalink
Merge pull request #2814 from ClearlyClaire/glitch-soc/merge-upstream
Browse files Browse the repository at this point in the history
Merge upstream changes up to 5d04e29
  • Loading branch information
ClearlyClaire authored Aug 15, 2024
2 parents d844537 + 104c378 commit d6c80f6
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 10 deletions.
13 changes: 11 additions & 2 deletions app/javascript/flavours/glitch/styles/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7924,9 +7924,18 @@ img.modal-warning {
}

.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;
}
}

Expand Down
13 changes: 11 additions & 2 deletions app/javascript/styles/mastodon/components.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
12 changes: 9 additions & 3 deletions spec/support/capybara.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,20 @@

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,
Expand Down
3 changes: 3 additions & 0 deletions spec/system/log_out_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@

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
Expand Down

0 comments on commit d6c80f6

Please sign in to comment.