diff --git a/app/assets/javascripts/tailwind/bar_graph.js b/app/assets/javascripts/tailwind/bar_graph.js index 9ede79f02..bbe5b9aae 100644 --- a/app/assets/javascripts/tailwind/bar_graph.js +++ b/app/assets/javascripts/tailwind/bar_graph.js @@ -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") diff --git a/spec/features/authorities_spec.rb b/spec/features/authorities_spec.rb index 2193be06f..e50816bd6 100644 --- a/spec/features/authorities_spec.rb +++ b/spec/features/authorities_spec.rb @@ -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