Skip to content

Commit 8f174d5

Browse files
committed
Add a/b breadcrumb test and fix failing specialist document test
Show b variant for contextual breadcrumbs add blah remove tab
1 parent bfd1176 commit 8f174d5

File tree

5 files changed

+31
-6
lines changed

5 files changed

+31
-6
lines changed

Gemfile

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ gem 'gds-api-adapters', '~> 52.6'
1717
gem 'govuk_ab_testing', '~> 2.4'
1818
gem 'govuk_app_config', '~> 1.6'
1919
gem 'govuk_frontend_toolkit', '~> 7.6'
20-
gem 'govuk_publishing_components', '~> 9.7.0'
20+
gem 'govuk_publishing_components', '~> 9.8.0'
2121
gem 'plek', '~> 2.1'
2222
gem 'slimmer', '~> 13.0'
2323

Gemfile.lock

+3-3
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ GEM
7676
archive-zip (~> 0.10)
7777
nokogiri (~> 1.8)
7878
coderay (1.1.2)
79-
commander (4.4.5)
79+
commander (4.4.6)
8080
highline (~> 1.7.2)
8181
concurrent-ruby (1.0.5)
8282
crack (0.4.3)
@@ -126,7 +126,7 @@ GEM
126126
govuk_frontend_toolkit (7.6.0)
127127
railties (>= 3.1.0)
128128
sass (>= 3.2.0)
129-
govuk_publishing_components (9.7.0)
129+
govuk_publishing_components (9.8.0)
130130
govspeak (>= 5.0.3)
131131
govuk_app_config
132132
govuk_frontend_toolkit
@@ -365,7 +365,7 @@ DEPENDENCIES
365365
govuk_ab_testing (~> 2.4)
366366
govuk_app_config (~> 1.6)
367367
govuk_frontend_toolkit (~> 7.6)
368-
govuk_publishing_components (~> 9.7.0)
368+
govuk_publishing_components (~> 9.8.0)
369369
govuk_schemas (~> 3.2)
370370
htmlentities (~> 4.3)
371371
jasmine-rails

app/views/layouts/application.html.erb

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<% if @content_item.try(:back_link) %>
4040
<%= render 'govuk_publishing_components/components/back_link', href: @content_item.back_link %>
4141
<% else %>
42-
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.content_item.parsed_content %>
42+
<%= render 'govuk_publishing_components/components/contextual_breadcrumbs', content_item: @content_item.content_item.parsed_content, prioritise_taxon_breadcrumbs: show_new_navigation? %>
4343
<% end %>
4444

4545
<main role="main" id="content" class="<%= @content_item.schema_name.dasherize %>" lang="<%= I18n.locale %>">

test/integration/content_pages_navigation_test.rb

+25
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,31 @@ class ContentPagesNavigationTest < ActionDispatch::IntegrationTest
249249
refute page.has_css?('.gem-c-related-navigation__sub-heading', text: 'Explore the topic')
250250
end
251251

252+
test "shows parent-based breadcrumbs if variant a" do
253+
stub_empty_rummager
254+
taxons = THREE_TAXONS
255+
setup_and_visit_content_item_with_taxons('guide', taxons)
256+
257+
within('.gem-c-contextual-breadcrumbs') do
258+
assert page.has_css?('a', text: "Home")
259+
assert page.has_css?('a', text: "Childcare and parenting")
260+
assert page.has_css?('a', text: "Schools and education")
261+
end
262+
end
263+
264+
test "shows taxon breadcrumbs if variant b" do
265+
stub_empty_rummager
266+
setup_variant_b
267+
268+
taxons = THREE_TAXONS
269+
setup_and_visit_content_item_with_taxons('guide', taxons)
270+
271+
within('.gem-c-contextual-breadcrumbs') do
272+
assert page.has_css?('a', text: "Home")
273+
assert page.has_css?('a', text: "Becoming a wizard")
274+
end
275+
end
276+
252277
def stub_empty_services
253278
Supergroups::Services.any_instance.stubs(:all_services).returns({})
254279
end

test/integration/specialist_document_test.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def assert_nested_content_item(heading)
160160
test 'renders no start button when not set' do
161161
setup_and_visit_content_item('aaib-reports')
162162

163-
refute page.has_css?('.gem-c-button')
163+
refute page.has_css?('.gem-c-button', text: "Find out more")
164164
end
165165

166166
test 'renders start button' do

0 commit comments

Comments
 (0)