mirror of
https://github.com/rickbarrette/simple-aircraft-manager-rails.git
synced 2026-11-17 23:50:36 -05:00
Consistency and accessibility: one date/time format, lang, skip link, focus outlines, alt text, labelled icons, contrast; release notes updated
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
191eb030e8
commit
215efe6814
56 files changed
+146
-97
No files matched your search
@@ -0,0 +1,27 @@
|
||||
require "test_helper"
|
||||
|
||||
# Basics every page shares: language, skip link, alt text, and the date format.
|
||||
class AccessibilityTest < ActionDispatch::IntegrationTest
|
||||
setup do
|
||||
@owner = create_user("owner@example.com")
|
||||
@a = create_aircraft(owner: @owner, tail_number: "N12345")
|
||||
sign_in @owner
|
||||
end
|
||||
|
||||
test "pages declare their language and let keyboard users skip to the content" do
|
||||
[ root_path, aircraft_path(@a), aircraft_logbook_entries_path(@a), help_path ].each do |path|
|
||||
get path
|
||||
assert_select "html[lang=en]"
|
||||
assert_select "a.skip-link[href='#main']", text: "Skip to content"
|
||||
assert_select "main#main"
|
||||
assert_select "img:not([alt])", 0, "#{path}: every image has alt text"
|
||||
end
|
||||
end
|
||||
|
||||
test "dates read the same way everywhere" do
|
||||
@a.logbook_entries.create!(date: Date.new(2026, 11, 8), entry_type: "MAINTENANCE", text: "Changed oil", aircraft_hours_at_entry: 1000)
|
||||
get aircraft_logbook_entries_path(@a)
|
||||
assert_includes response.body, "Nov 8, 2026"
|
||||
refute_includes response.body, "November 08, 2026"
|
||||
end
|
||||
end
|
||||
@@ -70,7 +70,7 @@ class AdImportFlowTest < ActionDispatch::IntegrationTest
|
||||
assert_equal Date.new(2026, 9, 3), AdWatch.new(@aircraft).start_date # last import less 60 days
|
||||
sign_in @owner
|
||||
get aircraft_airworthiness_directives_path(@aircraft)
|
||||
assert_includes response.body, "Last import <strong>2026-11-02</strong>"
|
||||
assert_includes response.body, "Last import <strong>Nov 2, 2026</strong>"
|
||||
end
|
||||
travel_to Time.zone.local(2027, 12, 1) do # over a year: the first Monday-of-month email and the audit flag it
|
||||
assert DrsImport.renewal_due?(@aircraft)
|
||||
|
||||
@@ -24,6 +24,6 @@ class ConsumableRecordsPagingTest < ActionDispatch::IntegrationTest
|
||||
assert_select "turbo-frame#consumable-records-3", 0
|
||||
assert_select "thead", 0 # header only on the first page
|
||||
assert_select "h2", text: "Fuel Burn", count: 0
|
||||
assert_includes response.body, "2026-01-01" # the oldest record is reachable
|
||||
assert_includes response.body, "Jan 1, 2026" # the oldest record is reachable
|
||||
end
|
||||
end
|
||||
@@ -134,7 +134,7 @@ class GroupFourTest < ActionDispatch::IntegrationTest
|
||||
assert_select "input[data-wb-calculator-target=station][data-fuel=true][data-arm='48.0']"
|
||||
assert_select "input[data-wb-calculator-target=burn]"
|
||||
get aircraft_major_record_path(@a, alteration)
|
||||
assert_includes response.body, "2026-01-01: 1500.0 lb @ 39.50 in"
|
||||
assert_includes response.body, "Jan 1, 2026: 1500.0 lb @ 39.50 in"
|
||||
get aircraft_report_path(@a)
|
||||
assert_includes response.body, "Empty weight <strong>1,500.0 lb</strong>"
|
||||
|
||||
|
||||
@@ -55,7 +55,7 @@ class SquawkWorkflowTest < ActionDispatch::IntegrationTest
|
||||
assert @squawk.resolved?
|
||||
assert_equal [ "MAINTENANCE", "AP", "7654321", [] ], [ entry.entry_type, entry.signoff_certificate_type, entry.signoff_certificate_number, entry.missing_record_items ]
|
||||
get aircraft_squawks_path(@a)
|
||||
assert_select "a[href='#{aircraft_logbook_entry_path(@a, entry)}']", text: "Logbook 2026-11-01"
|
||||
assert_select "a[href='#{aircraft_logbook_entry_path(@a, entry)}']", text: "Logbook Nov 1, 2026"
|
||||
|
||||
other = @a.squawks.create!(priority: 2, issue_reported: "Chipped paint")
|
||||
patch resolve_aircraft_squawk_path(@a, other), params: { logbook: "existing", logbook_entry_id: entry.id }
|
||||
|
||||
Reference in new issue
Block a user