Using <h3> headings for the links had two disadvantages. First, it was the wrong heading level to use, since there was no <h2> tag before it. Second, headings are supposed to be followed by content associated to that heading; here, we had no content following the headings. So we're using a list of links and giving it a heading. We're adding styles so the page still looks like it used to, although these styles are certainly asking for improvements.
18 lines
534 B
Ruby
18 lines
534 B
Ruby
require "rails_helper"
|
|
|
|
describe Admin::Stats::EventLinksComponent do
|
|
it "renders an <h2> heading followed by a list of links" do
|
|
render_inline Admin::Stats::EventLinksComponent.new(
|
|
%w[legislation_annotation_created legislation_answer_created]
|
|
)
|
|
|
|
expect(page).to have_css "h2", exact_text: "Graphs"
|
|
expect(page).to have_link count: 2
|
|
|
|
page.find("ul") do |list|
|
|
expect(list).to have_link "legislation_annotation_created"
|
|
expect(list).to have_link "legislation_answer_created"
|
|
end
|
|
end
|
|
end
|