Skip to content

Commit

Permalink
CI: Fix failing tests and warnings
Browse files Browse the repository at this point in the history
* Fix warnings when running bin/rails test:all
* Fix image-alt rule violation text in tests
* Change image-alt rule violation text:

  ```diff
  -"image-alt: Images must have alternate text"
  +"image-alt: Images must have alternative text"
  ```
* Expand CI matrix to account for new Rails versions
  • Loading branch information
louis-antonopoulos authored and seanpdoyle committed Nov 18, 2024
1 parent 4e3837f commit a03dbd4
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 6 deletions.
12 changes: 12 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,24 @@ jobs:
- "3.1"
- "3.2"
rails-version:
- "8.0"
- "7.2"
- "7.1"
- "7.0"
- "6.1"
- "main"
exclude:
- ruby-version: "3.0"
rails-version: "7.2"
- ruby-version: "3.0"
rails-version: "8.0"
- ruby-version: "3.0"
rails-version: "main"
- ruby-version: "3.1"
rails-version: "7.2"
- ruby-version: "3.1"
rails-version: "8.0"
- ruby-version: "3.1"
rails-version: "main"

env:
Expand Down
4 changes: 4 additions & 0 deletions capybara_accessibility_audit.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,8 @@ Gem::Specification.new do |spec|
spec.add_dependency "capybara"
spec.add_dependency "axe-core-api"
spec.add_dependency "zeitwerk"

spec.add_dependency "bigdecimal"
spec.add_dependency "drb"
spec.add_dependency "mutex_m"
end
6 changes: 3 additions & 3 deletions spec/system/audit_assertions_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

it "raises violations within a skip_accessibility_violation block that does not apply" do
skip_accessibility_violations "label" do
assert_rule_violation "image-alt: Images must have alternate text" do
assert_rule_violation "image-alt: Images must have alternative text" do
visit violations_path(rules: %w[image-alt])
end
end
Expand Down Expand Up @@ -93,7 +93,7 @@
go_back

with_accessibility_audits do
assert_rule_violation "image-alt: Images must have alternate text" do
assert_rule_violation "image-alt: Images must have alternative text" do
click_on "Violate rule: image-alt"
end
end
Expand All @@ -104,7 +104,7 @@

assert_rule_violation(
with: "label: Form elements must have labels",
without: "image-alt: Images must have alternate text"
without: "image-alt: Images must have alternative text"
) do
assert_no_accessibility_violations checking: "label", skipping: "image-alt"
end
Expand Down
6 changes: 3 additions & 3 deletions test/system/audit_assertions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class AuditAssertionsTest < ApplicationSystemTestCase

test "raises violations within a skip_accessibility_violation block that does not apply" do
skip_accessibility_violations "label" do
assert_rule_violation "image-alt: Images must have alternate text" do
assert_rule_violation "image-alt: Images must have alternative text" do
visit violations_path(rules: %w[image-alt])
end
end
Expand Down Expand Up @@ -108,7 +108,7 @@ class DisablingAuditAssertionsTest < ApplicationSystemTestCase
go_back

with_accessibility_audits do
assert_rule_violation "image-alt: Images must have alternate text" do
assert_rule_violation "image-alt: Images must have alternative text" do
click_on "Violate rule: image-alt"
end
end
Expand All @@ -119,7 +119,7 @@ class DisablingAuditAssertionsTest < ApplicationSystemTestCase

assert_rule_violation(
with: "label: Form elements must have labels",
without: "image-alt: Images must have alternate text"
without: "image-alt: Images must have alternative text"
) do
assert_no_accessibility_violations checking: "label", skipping: "image-alt"
end
Expand Down

0 comments on commit a03dbd4

Please sign in to comment.