Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AP1540 Accessibility fix for Savings and Investments and other assets page #1662

Merged
merged 2 commits into from
Aug 14, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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