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

updated voting registration requested #507

Merged
merged 1 commit into from
Jan 12, 2024
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
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 InterestedInVoterRegistration implements Condition {

@Override
public Boolean run(Submission submission) {
var inputData = submission.getInputData();
if (inputData.containsKey("votingRegistrationRequested")) {
return submission.getInputData().get("votingRegistrationRequested").equals("Yes");
}
return false;
}
}
2 changes: 2 additions & 0 deletions src/main/resources/flows-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,8 @@ flow:
registerToVote:
nextScreens:
- name: registerToVoteHelp
condition: InterestedInVoterRegistration
- name: raceEthnicityAsk
registerToVoteHelp:
nextScreens:
- name: raceEthnicityAsk
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,6 +808,13 @@ void fullDigitalAssisterFlow() {
assertThat(testPage.getTitle()).isEqualTo(message("medicaid.title"));
testPage.clickButton(message("medicaid.yes"));

assertThat(testPage.getTitle()).isEqualTo(message("voter-registration.title"));
testPage.selectRadio("votingRegistrationRequested", "No");
testPage.clickContinue();

assertThat(testPage.getTitle()).isEqualTo(message("race-ethnicity.title"));
testPage.goBack();

assertThat(testPage.getTitle()).isEqualTo(message("voter-registration.title"));
testPage.selectRadio("votingRegistrationRequested", "Yes");
testPage.clickContinue();
Expand Down
Loading