-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change behaviour of cards so the heading is dependent on page tier. Co-authored-by: dfeetenby <[email protected]>
- Loading branch information
1 parent
c3dd080
commit 4cffaff
Showing
4 changed files
with
53 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -60,3 +60,7 @@ uml/*.* | |
!uml/*.puml | ||
|
||
nscacert.pem | ||
|
||
# YARD documentation files | ||
*.yardoc | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
RSpec.describe 'Card heading levels based on tier' do | ||
describe 'Homepage renders h3 for tier1 card' do | ||
before do | ||
visit '/homepage' | ||
end | ||
|
||
it 'renders h3 for tier1 card' do | ||
all('.hf-card-details').each do |card| | ||
within card do | ||
expect(page).to have_css('h3.govuk-heading-m', text: 'Card Title') | ||
expect(page).not_to have_css('h2.govuk-heading-m') | ||
end | ||
end | ||
end | ||
end | ||
|
||
describe 'Section page renders h2 for tier2 card' do | ||
before do | ||
visit '/section-page' | ||
end | ||
|
||
it 'renders h2 for tier2 card' do | ||
all('.hf-card-details').each do |card| | ||
within card do | ||
expect(page).to have_css('h2.govuk-heading-m', text: 'Card Title') | ||
expect(page).not_to have_css('h3.govuk-heading-m') | ||
end | ||
end | ||
end | ||
end | ||
end |