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

AP-3809: Means assessment capital check your answers page #5864

Merged
merged 6 commits into from
Oct 23, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
AP-3809: Bank account section content changes
Update content in bank account section. Change
instances of "No" and "None" to match designs.
Update feature tests so they still pass.
agoldstone93 committed Oct 23, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit b07e14631107230b5f4ec844e0a2c4ebf87c7290
2 changes: 1 addition & 1 deletion app/helpers/capital_helper.rb
Original file line number Diff line number Diff line change
@@ -53,7 +53,7 @@ def capital_amount_items(items, locale_namespace, percentage_values)

def capital_amount_text(amount, type)
if amount.nil?
"No"
t("generic.no")
elsif type == :percentage
number_to_percentage(amount, precision: 2)
else
2 changes: 1 addition & 1 deletion app/helpers/policy_disregards_helper.rb
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ def policy_disregards_list(policy_disregards)
items&.compact!

items.map do |item|
item.amount_text ||= "No"
item.amount_text ||= t("generic.no")
end

{
17 changes: 9 additions & 8 deletions app/views/shared/check_answers/_assets.html.erb
Original file line number Diff line number Diff line change
@@ -9,20 +9,21 @@
<section class="print-no-break">
<%= render "shared/check_answers/vehicles", read_only:, individual: %>

<h2 class="govuk-heading-m"><%= t(".assets.bank_accounts") %></h2>
<% if @legal_aid_application.non_passported? && !@legal_aid_application.uploading_bank_statements? %>
<!-- non-passported truelayer only -->

<% if read_only %>
<h2 class="govuk-heading-m"><%= t(".assets.bank_accounts") %></h2>
<h3 class="govuk-heading-m"><%= t(".assets.client_bank_accounts") %></h2>

<%= govuk_summary_list(classes: "govuk-!-margin-bottom-9", html_attributes: { "data-test": "applicant-bank-accounts" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__online_current_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.current_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { online_current_accounts.present? ? gds_number_to_currency(online_current_accounts) : t("generic.none_declared") } %>
<%= row.with_value { online_current_accounts.present? ? gds_number_to_currency(online_current_accounts) : t("generic.none") } %>
<% end %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__online_savings_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.savings_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { online_savings_accounts.present? ? gds_number_to_currency(online_savings_accounts) : t("generic.none_declared") } %>
<%= row.with_value { online_savings_accounts.present? ? gds_number_to_currency(online_savings_accounts) : t("generic.none") } %>
<% end %>
<% end %>
<% end %>
@@ -34,7 +35,7 @@
"shared/check_answers/one_link_section",
name: :bank_accounts,
url: check_answer_url_for(journey_type, :offline_accounts, @legal_aid_application),
question: t(".assets.bank_accounts"),
question: t(".assets.client_bank_accounts"),
answer_hash: capital_accounts_list(
@legal_aid_application,
locale_namespace: "shared.forms.revealing_checkbox.attribute.#{journey_type}.bank_accounts.check_box_",
@@ -68,11 +69,11 @@
<%= govuk_summary_list(classes: "govuk-!-margin-bottom-9", html_attributes: { "data-test": "partner-bank-accounts" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__partner_online_current_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.current_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_current_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_current_accounts) : t("generic.none") } %>
<% end %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__partner_online_savings_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.savings_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_savings_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.partner_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.partner_offline_savings_accounts) : t("generic.none") } %>
<% end %>
<% end %>
<% end %>
@@ -97,11 +98,11 @@
<%= govuk_summary_list(classes: "govuk-!-margin-bottom-9", html_attributes: { "data-test": "joint-bank-accounts" }) do |summary_list| %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__joint_online_current_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.current_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_current_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_current_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_current_accounts) : t("generic.none") } %>
<% end %>
<%= summary_list.with_row(html_attributes: { id: "app-check-your-answers__joint_online_savings_accounts" }) do |row| %>
<%= row.with_key(text: t(".assets.savings_account"), classes: "govuk-!-width-one-half") %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_savings_accounts) : t("generic.none_declared") } %>
<%= row.with_value { @legal_aid_application.savings_amount.joint_offline_savings_accounts.present? ? gds_number_to_currency(@legal_aid_application.savings_amount.joint_offline_savings_accounts) : t("generic.none") } %>
<% end %>
<% end %>
<% end %>
7 changes: 4 additions & 3 deletions config/locales/en/shared.yml
Original file line number Diff line number Diff line change
@@ -244,9 +244,10 @@ en:
savings_and_investments_with_partner: Which savings or investments does either your client or their partner have?
savings_account: Savings account
current_account: Current account
bank_accounts: Which bank accounts does your client have?
partner_bank_accounts: Which bank accounts does the partner have?
joint_bank_accounts: Joint bank accounts
bank_accounts: Bank accounts
client_bank_accounts: Your client's accounts
partner_bank_accounts: The partner's accounts
joint_bank_accounts: Joint accounts
property:
heading_own_home: Property
heading_property_details: Your client's property
12 changes: 6 additions & 6 deletions features/providers/means_report.feature
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@ Feature: Means report
| h2 | Property, savings and other assets |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
@@ -132,7 +132,7 @@ Feature: Means report
| The vehicle was bought more than three years ago? |
| Is the vehicle in regular use? |

And the "Which bank accounts does your client have?", for static bank account totals, questions should exist:
And the "Bank accounts", for static bank account totals, questions should exist:
| question |
| Current account |
| Savings account |
@@ -192,7 +192,7 @@ Feature: Means report
| h2 | Property, savings and other assets |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h3 | Does your client have any savings accounts they cannot access online? |
| h2 | Property, savings and other assets |
| h2 | Which savings or investments does your client have? |
@@ -300,7 +300,7 @@ Feature: Means report
| The vehicle was bought more than three years ago? |
| Is the vehicle in regular use? |

And the "Which bank accounts does your client have?", for open banking accounts, questions should exist:
And the "Bank accounts", for open banking accounts, questions should exist:
| question |
| Current account |
| Savings account |
@@ -359,7 +359,7 @@ Feature: Means report
| h2 | Property, savings and other assets |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
@@ -403,7 +403,7 @@ Feature: Means report
| h2 | Property, savings and other assets |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
8 changes: 4 additions & 4 deletions features/providers/review_and_print.feature
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@ Feature: Review and print your application
| h2 | Your client's capital |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
@@ -64,7 +64,7 @@ Feature: Review and print your application
| h2 | Your client's capital |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
@@ -97,7 +97,7 @@ Feature: Review and print your application
| h3 | Regular payments |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h3 | Does your client have any savings accounts they cannot access online? |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
@@ -160,7 +160,7 @@ Feature: Review and print your application
| h3 | Regular payments |
| h3 | Property |
| h3 | Vehicles |
| h2 | Which bank accounts does your client have? |
| h2 | Bank accounts |
| h2 | Which savings or investments does your client have? |
| h2 | Which assets does your client have? |
| h2 | Restrictions on your client's assets |
4 changes: 2 additions & 2 deletions features/step_definitions/means_report_steps.rb
Original file line number Diff line number Diff line change
@@ -222,11 +222,11 @@
end
end

Then("the \"Which bank accounts does your client have?\", for static bank account totals, questions should exist:") do |table|
Then("the \"Bank accounts\", for static bank account totals, questions should exist:") do |table|
expect_questions_in(selector: "#app-check-your-answers__bank_accounts_items", expected: table)
end

Then("the \"Which bank accounts does your client have?\", for open banking accounts, questions should exist:") do |table|
Then("the \"Bank accounts\", for open banking accounts, questions should exist:") do |table|
expect_questions_in(selector: "[data-test=\"applicant-bank-accounts\"]", expected: table)
end

Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@
context "and they have offline bank_accounts" do
it "shows the partner bank values" do
expect(page).to have_css("#app-check-your-answers__partner_offline_savings_accounts",
text: "Which bank accounts does the partner have?")
text: "The partner's accounts")
end
end
end