Skip to content

Commit

Permalink
Merge pull request #1662 from ministryofjustice/ap-1540-accessibility…
Browse files Browse the repository at this point in the history
…-savings-investments

AP1540 Accessibility fix for Savings and Investments and other assets page
  • Loading branch information
Obsiye committed Aug 14, 2020
2 parents 92f02fb + 5d6fd44 commit ef0b269
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/views/shared/forms/_offline_accounts_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<%= govuk_form_group show_error_if: @form.errors.present? do %>
<fieldset class="govuk-fieldset" aria-describedby="select-all-that-apply-hint">
<%= govuk_fieldset_header page_title %>
<h2 class="govuk-heading-m"><%= t('generic.select_all_that_apply') %></h2>
<span id="select-all-that-apply-hint" class="govuk-hint"><%= t('generic.select_all_that_apply') %></span>

<%= render 'shared/show_errors' %>

Expand Down
4 changes: 2 additions & 2 deletions app/views/shared/forms/_savings_and_investments_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
<%= govuk_form_group show_error_if: @form.errors.present? do %>
<fieldset class="govuk-fieldset" aria-describedby="select-all-that-apply-hint">
<%= govuk_fieldset_header page_title %>
<h2 class="govuk-heading-m"><%= t('generic.select_all_that_apply') %></h2>
<span id="select-all-that-apply-hint" class="govuk-hint"><%= t('generic.select_all_that_apply') %></span>

<%= render 'shared/show_errors' %>
<%= render 'shared/show_errors' unless @form.any_checkbox_checked? %>

<div class="govuk-checkboxes" data-module="govuk-checkboxes">
<div class="deselect-group" data-deselect-ctrl="[name='savings_amount[none_selected]']">
Expand Down
2 changes: 1 addition & 1 deletion app/views/shared/forms/other_assets/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= govuk_form_group show_error_if: (@form.errors.present? && !@form.any_checkbox_checked?) do %>
<fieldset class="govuk-fieldset" aria-describedby="select-all-that-apply-hint">
<%= govuk_fieldset_header page_title %>
<h2 class="govuk-heading-m"><%= t('generic.select_all_that_apply') %></h2>
<span id="select-all-that-apply-hint" class="govuk-hint"><%= t('generic.select_all_that_apply') %></span>

<%= render 'shared/show_errors' %>

Expand Down
16 changes: 16 additions & 0 deletions spec/requests/providers/savings_and_investments_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,22 @@
expect(response.body).to match('govuk-form-group--error')
end
end

context 'checkbox checked with no value entered' do
let(:params) do
{
savings_amount: {
cash: '',
check_box_cash: 'true'
}
}
end

it 'displays error for field' do
subject
expect(response.body).to match(I18n.t('activemodel.errors.models.savings_amount.attributes.cash.blank'))
end
end
end

context 'when in checking passported answers state' do
Expand Down

0 comments on commit ef0b269

Please sign in to comment.