From 54d5cbdf3519d0d80df0ebb1c7399e08eab84443 Mon Sep 17 00:00:00 2001 From: Ana Medrano Fernandez <8609011+analoo@users.noreply.github.com> Date: Thu, 12 Oct 2023 16:57:59 -0700 Subject: [PATCH] Implement household sensitive questions flow (#348) * basic implementation of screens * before save action cleans up data * tests :) * just cleaned up code a bit and made names more intuitive --------- Co-authored-by: Ana Medrano Fernandez <amedrano@codeforamerica.org@Anas-MacBook-Pro-2.local> --- .../app/inputs/LaDigitalAssister.java | 22 ++++++- .../ReformatPersonalSituationUserData.java | 61 +++++++++++++++++++ .../HouseholdHasPersonalSituations.java | 17 ++++++ src/main/resources/flows-config.yaml | 6 +- src/main/resources/messages.properties | 49 +++++++++++++-- .../householdCriminalJusticeSituations.html | 21 ++++--- .../householdMoreInfoPersonalSituations.html | 29 --------- .../householdPersonalSituations.html | 24 +++++--- .../householdPersonalSituationsWho.html | 17 +++--- ...holdSensitiveQuestionsCriminalJustice.html | 19 ++---- .../householdVictimOfDomesticViolence.html | 18 +++--- .../householdWhichPersonalSituations.html | 40 +++++++++--- .../LaDigitalAssisterFlowJourneyTest.java | 28 ++++++++- 13 files changed, 257 insertions(+), 94 deletions(-) create mode 100644 src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java create mode 100644 src/main/java/org/ladocuploader/app/submission/conditions/HouseholdHasPersonalSituations.java delete mode 100644 src/main/resources/templates/laDigitalAssister/householdMoreInfoPersonalSituations.html diff --git a/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java b/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java index 225e1c559..f130ccb66 100644 --- a/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java +++ b/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java @@ -108,6 +108,26 @@ public class LaDigitalAssister extends FlowInputs { private String householdSearchingForJob; private String jobSearch; - + + // Sensitive Questions + private String householdHasPersonalSituations; + + private String personalSituationsHouseholdUUID; + + private List<String> personalSituationsListed; + + private String householdHasDomesticViolenceSituation; + + private String householdHasCriminalJusticeSituation; + + private String personalSituationHomelessSwitch; + + private String personalSituationOtherIssue; + + private String personalSituationStrugglingDrugsAlcohol; + + private String personalSituationDomesticViolenceFlag; + + private String personalSituationDisability; } diff --git a/src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java b/src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java new file mode 100644 index 000000000..a6b7abaa4 --- /dev/null +++ b/src/main/java/org/ladocuploader/app/submission/actions/ReformatPersonalSituationUserData.java @@ -0,0 +1,61 @@ +package org.ladocuploader.app.submission.actions; + +import formflow.library.config.submission.Action; +import formflow.library.data.Submission; +import java.util.ArrayList; +import java.util.LinkedHashMap; +import java.util.Map; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Component; + +/** + * + */ +@Component +@Slf4j +public class ReformatPersonalSituationUserData implements Action { + + @Override + public void run(Submission submission) { + Map<String, Object> inputData = submission.getInputData(); + + submission.getInputData().put("affectedByPersonalSituations[]", reformatPersonalSituations(inputData)); + } + + private ArrayList<LinkedHashMap> reformatPersonalSituations(Map<String, Object> inputData) { + ArrayList<LinkedHashMap> householdMembers = (ArrayList) inputData.get("household"); + ArrayList<String> hasPersonalSituations = (ArrayList) inputData.get("personalSituationsHouseholdUUID[]"); + ArrayList<LinkedHashMap> personalSituationsObject = new ArrayList<>(); + + hasPersonalSituations.forEach((String id) -> { + LinkedHashMap user = new LinkedHashMap(); + if (id.equals("you")) { + user.put("uuid", id); + user.put("firstName", inputData.get("firstName") + " (you)"); + user.put("lastName", inputData.get("lastName")); + personalSituationsObject.add(user); + } else { + personalSituationsObject.add(householdData(householdMembers, id)); + } + } + ); + + return personalSituationsObject; + + } + + private LinkedHashMap householdData(ArrayList<LinkedHashMap> household, String uuid) { + LinkedHashMap user = new LinkedHashMap(); + for (LinkedHashMap hhmember : household) { + if (hhmember.get("uuid").equals(uuid)) { + user.put("uuid", uuid); + user.put("firstName", hhmember.get("householdMemberFirstName")); + user.put("lastName", hhmember.get("householdMemberLastName")); + continue; + } + } + + return user; + }; + +} diff --git a/src/main/java/org/ladocuploader/app/submission/conditions/HouseholdHasPersonalSituations.java b/src/main/java/org/ladocuploader/app/submission/conditions/HouseholdHasPersonalSituations.java new file mode 100644 index 000000000..cc57c56e2 --- /dev/null +++ b/src/main/java/org/ladocuploader/app/submission/conditions/HouseholdHasPersonalSituations.java @@ -0,0 +1,17 @@ +package org.ladocuploader.app.submission.conditions; + +import formflow.library.config.submission.Condition; +import formflow.library.data.Submission; +import org.springframework.stereotype.Component; + +@Component +public class HouseholdHasPersonalSituations implements Condition { + @Override + public Boolean run(Submission submission) { + var inputData = submission.getInputData(); + if (inputData.containsKey("householdHasPersonalSituations")) { + return submission.getInputData().get("householdHasPersonalSituations").equals("true"); + } + return false; + } +} diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml index 637f21e68..c34722728 100644 --- a/src/main/resources/flows-config.yaml +++ b/src/main/resources/flows-config.yaml @@ -188,13 +188,13 @@ flow: householdPersonalSituations: nextScreens: - name: householdPersonalSituationsWho + condition: HouseholdHasPersonalSituations + - name: householdVictimOfDomesticViolence householdPersonalSituationsWho: + beforeSaveAction: ReformatPersonalSituationUserData nextScreens: - name: householdWhichPersonalSituations householdWhichPersonalSituations: - nextScreens: - - name: householdMoreInfoPersonalSituations - householdMoreInfoPersonalSituations: nextScreens: - name: householdVictimOfDomesticViolence householdVictimOfDomesticViolence: diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties index 94ce40290..128043ad1 100644 --- a/src/main/resources/messages.properties +++ b/src/main/resources/messages.properties @@ -383,11 +383,6 @@ phone-number-nudge.skip-phone-number=Continue without it # Shared Household Messages -#Sensitive Questions -sensitive-questions.title=Sensitive Questions -sensitive-questions.header=Next, we have questions about situations that make it hard to work. -sensitive-questions.subheader=We're sorry that we're asking about these sensitive subjects. Sharing information about any barriers to working will give you the best chance of getting benefits. - # Multiple person household multiple-person-household.title=Multiple person household multiple-person-household.header=Do you live with any of these people? @@ -554,7 +549,6 @@ foster-aged-out.header=Was anyone in foster care until they turned 18? foster-aged-out-who.title=Foster aged out who foster-aged-out-who.header=Who was in foster care until they turned 18? - # Homelessness homeless.title=Homeless homeless.header=Is anyone in your household currently experiencing homelessness? @@ -578,3 +572,46 @@ job-search.header=Is anyone in your household currently looking for a job? job-search-who.title = Job search who job-search-who.header=Who in your household is looking for a job? +# Phone number nudge +phone-number-nudge.title=Phone number nudge +phone-number-nudge.header=Are you sure you don't want to provide your phone number? +phone-number-nudge.p1=A caseworker may need to contact you by phone about your application. If you don't have a phone number, you can enter a friend or family member's phone number instead. +phone-number-nudge.add-phone-number=Add a phone number +phone-number-nudge.skip-phone-number=Continue without it + +#Sensitive Questions +sensitive-questions.title=Sensitive Questions +sensitive-questions.header=Next, we have questions about situations that make it hard to work. +sensitive-questions.subheader=We're sorry that we're asking about these sensitive subjects. Sharing information about any barriers to working will give you the best chance of getting benefits. +personal-situations.title=Personal Situations +personal-situations.header=Do any of these personal situations that make it hard to work apply to anyone in your household? +personal-situations.subheader=This could be something that keeps them from working at all, or limits the amount they can work. +personal-situations.content.l1=Being homeless +personal-situations.content.l2=Struggling with drugs or alcohol +personal-situations.content.l3=Experiencing domestic abuse +personal-situations.content.l4=A physical, mental, or other personal issue or disability + +personal-situations-who.title=Personal Situations Who +personal-situations-who.header=Who has a personal situation that makes it hard to work? + +personal-situations-which.title=Which Personal Situations +personal-situations-which.subheader=Which personal situations apply to {0}? +personal-situations.which.option1=Being homeless +personal-situations.which.option2=Struggling with drugs or alcohol +personal-situations.which.option3=Experiencing domestic abuses +personal-situations.which.option4=A physical, mental, or other personal issue or disability +personal-situations.which.option5=Other reason + +domestic-violence.title=Domestic Violence Victim +domestic-violence.header=Does anyone in your household need to get away from an abusive situation? +domestic-violence.subheader=If you are a victim of domestic violence or fear for your safety, call the Louisiana Domestic Violence hotline at 1-888-411-1333 for free, confidential 24-hour assistance. + +criminal-justice-warning.title=Criminal Justice Involvement Warning +criminal-justice-warning.header=Next, we have questions about involvement with the criminal justice system. +criminal-justice-warning.subheader=We're sorry to ask about these sensitive subjects. This information is required to help determine eligibility for benefits. + +criminal-justice.title=Criminal Justice +criminal-justice.header=Do any of these situations apply to anyone in your household? +criminal-justice-content.l1=Have been convicted of breaking rules for SNAP, cash aid, or SSI programs +criminal-justice-content.l2=Have been convicted of a felony +criminal-justice-content.l3=Currently on probation or parole diff --git a/src/main/resources/templates/laDigitalAssister/householdCriminalJusticeSituations.html b/src/main/resources/templates/laDigitalAssister/householdCriminalJusticeSituations.html index 996398337..b6915425e 100644 --- a/src/main/resources/templates/laDigitalAssister/householdCriminalJusticeSituations.html +++ b/src/main/resources/templates/laDigitalAssister/householdCriminalJusticeSituations.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head> +<head th:replace="~{fragments/head :: head(title=#{criminal-justice.title})}"></head> <body> <div class="page-wrapper"> <div th:replace="~{fragments/toolbar :: toolbar}"></div> @@ -8,15 +8,22 @@ <div class="grid"> <div th:replace="~{fragments/goBack :: goBackLink}"></div> <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> + <th:block th:replace="~{fragments/icons :: personMilestone}"></th:block> + <th:block + th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{criminal-justice.header})}"/> + <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::criminalJusticeSituation})}"> + <th:block th:ref="criminalJusticeSituation"> <div class="form-card__content"> - + <ul class="list--bulleted"> + <li th:utext="#{criminal-justice-content.l1}"></li> + <li th:utext="#{criminal-justice-content.l2}"></li> + <li th:utext="#{criminal-justice-content.l3}"></li> + </ul> </div> <div class="form-card__footer"> - + <th:block th:replace="~{fragments/inputs/yesOrNo :: yesOrNo( + inputName='householdHasCriminalJusticeSituation', + ariaDescribe=#{criminal-justice.header})}"/> </div> </th:block> </th:block> diff --git a/src/main/resources/templates/laDigitalAssister/householdMoreInfoPersonalSituations.html b/src/main/resources/templates/laDigitalAssister/householdMoreInfoPersonalSituations.html deleted file mode 100644 index 996398337..000000000 --- a/src/main/resources/templates/laDigitalAssister/householdMoreInfoPersonalSituations.html +++ /dev/null @@ -1,29 +0,0 @@ -<!DOCTYPE html> -<html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head> -<body> -<div class="page-wrapper"> - <div th:replace="~{fragments/toolbar :: toolbar}"></div> - <section class="slab"> - <div class="grid"> - <div th:replace="~{fragments/goBack :: goBackLink}"></div> - <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> - <div class="form-card__content"> - - </div> - <div class="form-card__footer"> - - </div> - </th:block> - </th:block> - </main> - </div> - </section> -</div> -<th:block th:replace="~{fragments/footer :: footer}" /> -</body> -</html> \ No newline at end of file diff --git a/src/main/resources/templates/laDigitalAssister/householdPersonalSituations.html b/src/main/resources/templates/laDigitalAssister/householdPersonalSituations.html index 79723ed92..ec67c963c 100644 --- a/src/main/resources/templates/laDigitalAssister/householdPersonalSituations.html +++ b/src/main/resources/templates/laDigitalAssister/householdPersonalSituations.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Household Personal Situations')}"></head> +<head th:replace="~{fragments/head :: head(title=#{personal-situations.title})}"></head> <body> <div class="page-wrapper"> <div th:replace="~{fragments/toolbar :: toolbar}"></div> @@ -8,15 +8,23 @@ <div class="grid"> <div th:replace="~{fragments/goBack :: goBackLink}"></div> <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> + <th:block th:replace="~{fragments/icons :: briefcase}"></th:block> + <th:block + th:replace="~{fragments/cardHeader :: cardHeader(header=#{personal-situations.header}, subtext=#{personal-situations.subheader})}"/> + <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::householdPersonalSituations})}"> + <th:block th:ref="householdPersonalSituations"> <div class="form-card__content"> - + <ul class="list--bulleted"> + <li th:utext="#{personal-situations.content.l1}"></li> + <li th:utext="#{personal-situations.content.l2}"></li> + <li th:utext="#{personal-situations.content.l3}"></li> + <li th:utext="#{personal-situations.content.l4}"></li> + </ul> </div> <div class="form-card__footer"> - + <th:block th:replace="~{fragments/inputs/yesOrNo :: yesOrNo( + inputName='householdHasPersonalSituations', + ariaDescribe=#{personal-situations.header})}"/> </div> </th:block> </th:block> @@ -26,4 +34,4 @@ </div> <th:block th:replace="~{fragments/footer :: footer}" /> </body> -</html> \ No newline at end of file +</html> diff --git a/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html b/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html index 996398337..631baa711 100644 --- a/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html +++ b/src/main/resources/templates/laDigitalAssister/householdPersonalSituationsWho.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head> +<head th:replace="~{fragments/head :: head(title=#{personal-situations-who.title})}"></head> <body> <div class="page-wrapper"> <div th:replace="~{fragments/toolbar :: toolbar}"></div> @@ -8,15 +8,18 @@ <div class="grid"> <div th:replace="~{fragments/goBack :: goBackLink}"></div> <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> + <th:block th:replace="~{fragments/icons :: briefcase}"></th:block> + <th:block + th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{personal-situations-who.header})}"/> + <th:block th:replace="~{fragments/form :: form(action=${formAction}, content=~{::formContents})}"> + <th:block th:ref="formContents"> <div class="form-card__content"> - + <th:block th:replace="~{'fragments/inputs/householdCheckboxFieldset' :: + householdCheckboxFieldset(inputName='personalSituationsHouseholdUUID')}"/> </div> <div class="form-card__footer"> - + <th:block th:replace="~{fragments/inputs/submitButton :: submitButton( + text=#{general.inputs.continue})}"/> </div> </th:block> </th:block> diff --git a/src/main/resources/templates/laDigitalAssister/householdSensitiveQuestionsCriminalJustice.html b/src/main/resources/templates/laDigitalAssister/householdSensitiveQuestionsCriminalJustice.html index 996398337..3981f443d 100644 --- a/src/main/resources/templates/laDigitalAssister/householdSensitiveQuestionsCriminalJustice.html +++ b/src/main/resources/templates/laDigitalAssister/householdSensitiveQuestionsCriminalJustice.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head> +<head th:replace="~{fragments/head :: head(title=#{criminal-justice-warning.title})}"></head> <body> <div class="page-wrapper"> <div th:replace="~{fragments/toolbar :: toolbar}"></div> @@ -8,18 +8,11 @@ <div class="grid"> <div th:replace="~{fragments/goBack :: goBackLink}"></div> <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> - <div class="form-card__content"> - - </div> - <div class="form-card__footer"> - - </div> - </th:block> - </th:block> + <th:block + th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{criminal-justice-warning.header}, subtext=#{criminal-justice-warning.subheader})}"/> + <div class="form-card__footer spacing-below-35"> + <th:block th:replace="~{fragments/continueButton :: continue}"/> + </div> </main> </div> </section> diff --git a/src/main/resources/templates/laDigitalAssister/householdVictimOfDomesticViolence.html b/src/main/resources/templates/laDigitalAssister/householdVictimOfDomesticViolence.html index 996398337..8e17a9e9c 100644 --- a/src/main/resources/templates/laDigitalAssister/householdVictimOfDomesticViolence.html +++ b/src/main/resources/templates/laDigitalAssister/householdVictimOfDomesticViolence.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head> +<head th:replace="~{fragments/head :: head(title=#{domestic-violence.title})}"></head> <body> <div class="page-wrapper"> <div th:replace="~{fragments/toolbar :: toolbar}"></div> @@ -8,15 +8,15 @@ <div class="grid"> <div th:replace="~{fragments/goBack :: goBackLink}"></div> <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> - <div class="form-card__content"> - - </div> + <th:block th:replace="~{fragments/icons :: medicalInOtherState}"></th:block> + <th:block + th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{domestic-violence.header}, subtext=#{domestic-violence.subheader})}"/> + <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::hhDomesticViolence})}"> + <th:block th:ref="hhDomesticViolence"> <div class="form-card__footer"> - + <th:block th:replace="~{fragments/inputs/yesOrNo :: yesOrNo( + inputName='householdHasDomesticViolenceSituation', + ariaDescribe=#{domestic-violence.header})}"/> </div> </th:block> </th:block> diff --git a/src/main/resources/templates/laDigitalAssister/householdWhichPersonalSituations.html b/src/main/resources/templates/laDigitalAssister/householdWhichPersonalSituations.html index 996398337..a0d097b69 100644 --- a/src/main/resources/templates/laDigitalAssister/householdWhichPersonalSituations.html +++ b/src/main/resources/templates/laDigitalAssister/householdWhichPersonalSituations.html @@ -1,6 +1,6 @@ <!DOCTYPE html> <html th:lang="${#locale.language}"> -<head th:replace="~{fragments/head :: head(title='Scaffold')}"></head> +<head th:replace="~{fragments/head :: head(title=#{personal-situations-which.title})}"></head> <body> <div class="page-wrapper"> <div th:replace="~{fragments/toolbar :: toolbar}"></div> @@ -8,22 +8,42 @@ <div class="grid"> <div th:replace="~{fragments/goBack :: goBackLink}"></div> <main id="content" role="main" class="form-card spacing-above-35"> - <!-- <th:block--> - <!-- th:replace="~{'fragments/cardHeader' :: cardHeader(header=#{}, subtext=#{})}"/>--> - <th:block th:replace="~{'fragments/form' :: form(action=${formAction}, content=~{::formContent})}"> - <th:block th:ref="formContent"> - <div class="form-card__content"> - + <th:block th:replace="~{fragments/icons :: briefcase}"></th:block> + <th:block + th:replace="~{fragments/form :: form(action=${formAction}, content=~{::whichHouseholdSituations})}"> + <th:block th:ref="whichHouseholdSituations"> + <div th:each="individual, iter: ${inputData.get('affectedByPersonalSituations[]')}" + class="spacing-below-15"> + <th:block th:replace="~{'fragments/inputs/checkboxFieldset' :: + checkboxFieldset(inputName='personalSituationsListed', + ariaLabel='header', + content=~{::whichPersonalSituations})}"> + <th:block th:ref="whichPersonalSituations"> + <h2 th:text="#{personal-situations-which.subheader(${individual.firstName})}"></h2> + <p th:text="#{general.check-all-that-apply}"></p> + <th:block + th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationHomelessSwitch',value=${individual.uuid}, label=#{personal-situations.which.option1})}"/> + <th:block + th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationStrugglingDrugsAlcohol',value=${individual.uuid}, label=#{personal-situations.which.option2})}"/> + <th:block + th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationDomesticViolenceFlag',value=${individual.uuid}, label=#{personal-situations.which.option3})}"/> + <th:block + th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationDisability',value=${individual.uuid}, label=#{personal-situations.which.option4})}"/> + <th:block + th:replace="~{'fragments/inputs/checkboxInSet' :: checkboxInSet(inputName='personalSituationOtherIssue',value=${individual.uuid}, label=#{personal-situations.which.option5}, helptext=#{personal-situations.other.helptext})}"/> + </th:block> + </th:block> </div> <div class="form-card__footer"> - + <th:block th:replace="~{fragments/inputs/submitButton :: submitButton( + text=#{general.inputs.continue})}"/> </div> </th:block> </th:block> </main> </div> </section> + <th:block th:replace="~{fragments/footer :: footer}"/> </div> -<th:block th:replace="~{fragments/footer :: footer}" /> </body> -</html> \ No newline at end of file +</html> diff --git a/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java b/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java index be9e60c30..2adb3de0b 100644 --- a/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java +++ b/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java @@ -138,7 +138,33 @@ void fullDigitalAssisterFlow() { assertThat(testPage.getTitle()).isEqualTo("Sensitive Questions"); testPage.clickContinue(); - assertThat(testPage.getTitle()).isEqualTo("Household Personal Situations"); + // Case when no personal situations apply + assertThat(testPage.getTitle()).isEqualTo("Personal Situations"); + testPage.clickButton("No"); + assertThat(testPage.getTitle()).isEqualTo("Domestic Violence Victim"); + + + testPage.navigateToFlowScreen("laDigitalAssister/householdPersonalSituations"); + assertThat(testPage.getTitle()).isEqualTo("Personal Situations"); + + testPage.clickButton("Yes"); + assertThat(testPage.getTitle()).isEqualTo("Personal Situations Who"); + + testPage.clickContinue(); + assertThat(testPage.getTitle()).isEqualTo("Which Personal Situations"); + testPage.clickContinue(); + assertThat(testPage.getTitle()).isEqualTo("Domestic Violence Victim"); + + testPage.clickButton("Yes"); + assertThat(testPage.getTitle()).isEqualTo("Criminal Justice Involvement Warning"); + + testPage.clickContinue(); + assertThat(testPage.getTitle()).isEqualTo("Criminal Justice"); + + testPage.navigateToFlowScreen("laDigitalAssister/householdVictimOfDomesticViolence"); + assertThat(testPage.getTitle()).isEqualTo("Domestic Violence Victim"); + testPage.clickButton("No"); + assertThat(testPage.getTitle()).isEqualTo("Criminal Justice Involvement Warning"); } }