From 885d1c7b71f84d3f29778bc8e9123d9c532e98f2 Mon Sep 17 00:00:00 2001
From: Sree P
Date: Thu, 12 Oct 2023 17:42:58 -0700
Subject: [PATCH] Adding meals screens
---
.../app/inputs/LaDigitalAssister.java | 4 ++++
.../app/submission/conditions/PayForMeals.java | 13 +++++++++++++
src/main/resources/flows-config.yaml | 2 ++
src/main/resources/messages.properties | 7 +++++++
.../laDigitalAssister/householdMeals.html | 18 ++++++++----------
.../laDigitalAssister/householdMealsWho.html | 16 ++++++++++------
.../LaDigitalAssisterFlowJourneyTest.java | 13 +++++++++++--
7 files changed, 55 insertions(+), 18 deletions(-)
create mode 100644 src/main/java/org/ladocuploader/app/submission/conditions/PayForMeals.java
diff --git a/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java b/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
index 3de239c05..50a7de2b8 100644
--- a/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
+++ b/src/main/java/org/ladocuploader/app/inputs/LaDigitalAssister.java
@@ -109,6 +109,10 @@ public class LaDigitalAssister extends FlowInputs {
private String roomRentals;
+ private String mealInd;
+
+ private String meals;
+
private String householdSearchingForJob;
private String jobSearch;
diff --git a/src/main/java/org/ladocuploader/app/submission/conditions/PayForMeals.java b/src/main/java/org/ladocuploader/app/submission/conditions/PayForMeals.java
new file mode 100644
index 000000000..a84a5e7d9
--- /dev/null
+++ b/src/main/java/org/ladocuploader/app/submission/conditions/PayForMeals.java
@@ -0,0 +1,13 @@
+package org.ladocuploader.app.submission.conditions;
+
+import formflow.library.data.Submission;
+import org.springframework.stereotype.Component;
+
+@Component
+public class PayForMeals extends BasicCondition {
+
+ @Override
+ public Boolean run(Submission submission) {
+ return run(submission, "mealInd", "true");
+ }
+}
diff --git a/src/main/resources/flows-config.yaml b/src/main/resources/flows-config.yaml
index 89e90c201..5f707ecf6 100644
--- a/src/main/resources/flows-config.yaml
+++ b/src/main/resources/flows-config.yaml
@@ -181,6 +181,8 @@ flow:
householdMeals:
nextScreens:
- name: householdMealsWho
+ condition: PayForMeals
+ - name: sensitiveQuestions
householdMealsWho:
nextScreens:
- name: sensitiveQuestions
diff --git a/src/main/resources/messages.properties b/src/main/resources/messages.properties
index b0a496f80..6f888b07e 100644
--- a/src/main/resources/messages.properties
+++ b/src/main/resources/messages.properties
@@ -561,6 +561,13 @@ household-room-rental.header=Does anyone in your household rent a room?
household-room-rental-who.title=Room rental who
household-room-rental-who.header=Who rents a room?
+# Meals
+household-meals.title=Meals
+household-meals.header=Does anyone in your household pay for their meals as part of their living arrangements?
+household-meals.subtext=This could include:
- Someone who pays monthly for room and board
- Someone who receives at least 1 meal as part of rent
- Someone who receives more than half their meals from an organization
+household-meals-who.title=Meals who
+household-meals-who.header=Who pays for meals as part of their living arrangements?
+
# Review contact info
review-contact-info.title=Review contact information
review-contact-info.header=Let's review your info
diff --git a/src/main/resources/templates/laDigitalAssister/householdMeals.html b/src/main/resources/templates/laDigitalAssister/householdMeals.html
index 996398337..c8126fd4b 100644
--- a/src/main/resources/templates/laDigitalAssister/householdMeals.html
+++ b/src/main/resources/templates/laDigitalAssister/householdMeals.html
@@ -1,6 +1,6 @@
-
+
-
+
\ No newline at end of file
diff --git a/src/main/resources/templates/laDigitalAssister/householdMealsWho.html b/src/main/resources/templates/laDigitalAssister/householdMealsWho.html
index 996398337..14ef34cf1 100644
--- a/src/main/resources/templates/laDigitalAssister/householdMealsWho.html
+++ b/src/main/resources/templates/laDigitalAssister/householdMealsWho.html
@@ -1,6 +1,6 @@
-
+
@@ -8,15 +8,19 @@
-
-
+
+
-
+
+
@@ -24,6 +28,6 @@
-
+
\ No newline at end of file
diff --git a/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java b/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java
index e345ba921..653105f95 100644
--- a/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java
+++ b/src/test/java/org/ladocuploader/app/journeys/LaDigitalAssisterFlowJourneyTest.java
@@ -179,7 +179,7 @@ void fullDigitalAssisterFlow() {
assertThat(testPage.getTitle()).isEqualTo("Room rental");
testPage.clickButton("No");
- assertThat(testPage.getTitle()).isEqualTo("Scaffold"); // Meals
+ assertThat(testPage.getTitle()).isEqualTo("Meals");
testPage.goBack();
testPage.clickButton("Yes");
@@ -187,8 +187,17 @@ void fullDigitalAssisterFlow() {
testPage.clickElementById("roomRentals-you");
testPage.clickContinue();
+ assertThat(testPage.getTitle()).isEqualTo("Meals");
+ testPage.clickButton("No");
+ assertThat(testPage.getTitle()).isEqualTo("Sensitive Questions");
+ testPage.goBack();
+ testPage.clickButton("Yes");
+
+ assertThat(testPage.getTitle()).isEqualTo("Meals who");
+ testPage.clickElementById("meals-you");
+ testPage.clickContinue();
+
// Sensitive Questions
- testPage.navigateToFlowScreen("laDigitalAssister/sensitiveQuestions");
assertThat(testPage.getTitle()).isEqualTo("Sensitive Questions");
testPage.clickContinue();