From ec0bcd427700590c06097460d2e1e2b2726864ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javi=20Mart=C3=ADn?= Date: Sat, 14 Sep 2024 17:43:52 +0200 Subject: [PATCH] Use a more realistic size for small window tests The resolution of most devices is at least 640 pixels in at least one of their dimensions. Since we need the width to be smaller than 640 pixels, having a height of 479px wasn't realistic. Doing so caused the tests checking the sticky "support proposal" tests to fail because on 480px-high devices the sticky message covers the whole screen. This is a usability issue, but since I'm not sure how many people use such a small window when browsing the web, for now I'm simply changing the tests. We're changing the width to 320px since it's the width required by the Web Content Accessibility Guidelines 2.2. Quoting these guidelines [1]: > Content can be presented without loss of information or functionality, > and without requiring scrolling in two dimensions for: > * Vertical scrolling content at a width equivalent to 320 CSS pixels; > * Horizontal scrolling content at a height equivalent to 256 CSS > pixels. Note that, using a height of 256px, the sticky message would make the application unusable, though. IMHO we'll have to get rid of the sticky message sooner or later. --- spec/spec_helper.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 61738381b..2ee4b259b 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -126,7 +126,7 @@ RSpec.configure do |config| config.before(:each, :small_window) do @window_size = Capybara.current_window.size - Capybara.current_window.resize_to(639, 479) + Capybara.current_window.resize_to(320, 640) end config.after(:each, :small_window) do