Skip to content

Commit

Permalink
Make bar graph pass auto accessibility tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mlandauer committed Feb 15, 2024
1 parent 603f204 commit 5aa8b88
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 2 deletions.
3 changes: 1 addition & 2 deletions app/assets/javascripts/tailwind/bar_graph.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ function barGraph(selector, url, metric) {

var focusCallout = d3.select(selector)
.append("div")
.attr("class", "chart-callout")
.append("h5"),
.attr("class", "chart-callout"),
focusCalloutValue = focusCallout.append("span")
.attr("class", "chart-callout-heading"),
focusCalloutDate = focusCallout.append("span")
Expand Down
30 changes: 30 additions & 0 deletions spec/features/authorities_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,34 @@
end
# rubocop:enable RSpec/NoExpectationExample
end

describe "detail page for an authority in the new design" do
before do
# Give a name to the user so screenshots are consistent with percy
sign_in create(:confirmed_user, tailwind_theme: true, name: "Jane Ng")
authority = create(:authority, full_name: "Byron Shire Council", morph_name: "planningalerts-scrapers/byron")
# We need it to have at least one application so it's not "broken"
# TODO: I don't we think we need all the application information here
create(:geocoded_application,
authority:,
address: "24 Bruce Road Glenbrook",
description: "A lovely house",
lat: -33.772609,
lng: 150.624256,
lonlat: RGeo::Geographic.spherical_factory(srid: 4326).point(150.624256, -33.772609))
visit authority_path(authority.short_name_encoded)
end

describe "accessibility test", js: true do
it "passes" do
expect(page).to be_axe_clean
end
end

# rubocop:disable RSpec/NoExpectationExample
it "renders the page", js: true do
page.percy_snapshot("Authority")
end
# rubocop:enable RSpec/NoExpectationExample
end
end

0 comments on commit 5aa8b88

Please sign in to comment.