Skip to content

Commit

Permalink
[CCAP-357] Make the confirmation code input readonly (#1225)
Browse files Browse the repository at this point in the history
  • Loading branch information
cram-cfa authored Feb 28, 2025
1 parent 3a73d9e commit 81be535
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,13 @@

<script th:inline="javascript">
$(document).ready(function () {
const providerFamilyCode = $('#providerResponseFamilyShortCode')
const providerFamilyCode = document.getElementById("providerResponseFamilyShortCode");

if(!providerFamilyCode.text()){
if (!providerFamilyCode.textContent) {
var confirmationCode = [[${session.confirmationCode}]];
if(confirmationCode){
providerFamilyCode.val(confirmationCode)
if (confirmationCode) {
providerFamilyCode.value = confirmationCode;
providerFamilyCode.readOnly = true;
}
}
});
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.ilgcc.app.journeys;

import static org.assertj.core.api.Assertions.assertThat;
import static org.awaitility.Awaitility.await;

import formflow.library.data.SubmissionRepository;
import java.time.OffsetDateTime;
Expand All @@ -21,7 +20,7 @@ public class ProviderresponseProviderRegistrationJourneyTest extends AbstractBas
private static final String CONF_CODE = "A2123B";

@Test
void BasicInfoFlow() {
void basicInfoFlow() {
createAValidLink();

testPage.navigateToFlowScreen("providerresponse/registration-basic-info-intro");
Expand Down Expand Up @@ -127,7 +126,7 @@ void BasicInfoFlow() {
}

@Test
void LicenseExemptInProviderHomeFlow() {
void licenseExemptInProviderHomeFlow() {
createAValidLink();
submitFamilyConfirmationCode();

Expand Down Expand Up @@ -319,7 +318,6 @@ void LicenseExemptInProviderHomeFlow() {

// confirmation-code
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-confirmation-code.title"));
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();

// response
Expand Down Expand Up @@ -400,7 +398,7 @@ void LicenseExemptInProviderHomeFlow() {
}

@Test
void LicenseExemptInChildHomeFlow() {
void licenseExemptInChildHomeFlow() {
createAValidLink();
submitFamilyConfirmationCode();

Expand Down Expand Up @@ -522,7 +520,6 @@ void LicenseExemptInChildHomeFlow() {

// confirmation-code
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-confirmation-code.title"));
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();

// response
Expand Down Expand Up @@ -582,7 +579,7 @@ void LicenseExemptInChildHomeFlow() {
}

@Test
void LicensedChildCareHomeFlow() {
void licensedChildCareHomeFlow() {
createAValidLink();
submitFamilyConfirmationCode();

Expand Down Expand Up @@ -695,7 +692,6 @@ void LicensedChildCareHomeFlow() {

// confirmation-code
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-confirmation-code.title"));
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();

// response
Expand Down Expand Up @@ -754,7 +750,7 @@ void LicensedChildCareHomeFlow() {
}

@Test
void LicensedChildCareCenterFlow() {
void licensedChildCareCenterFlow() {
createAValidLink();
submitFamilyConfirmationCode();

Expand Down Expand Up @@ -849,7 +845,6 @@ void LicensedChildCareCenterFlow() {

// confirmation-code
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-confirmation-code.title"));
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();

// response
Expand Down Expand Up @@ -908,7 +903,7 @@ void LicensedChildCareCenterFlow() {
}

@Test
void LicensedGroupChildCareHomeFlow() {
void licensedGroupChildCareHomeFlow() {
createAValidLink();
submitFamilyConfirmationCode();

Expand Down Expand Up @@ -1012,7 +1007,6 @@ void LicensedGroupChildCareHomeFlow() {

// confirmation-code
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-confirmation-code.title"));
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();

// response
Expand Down Expand Up @@ -1071,7 +1065,7 @@ void LicensedGroupChildCareHomeFlow() {
}

@Test
void LicenseExemptChildCareCenter() {
void licenseExemptChildCareCenter() {
createAValidLink();
submitFamilyConfirmationCode();

Expand Down Expand Up @@ -1202,7 +1196,6 @@ void LicenseExemptChildCareCenter() {

// confirmation-code
assertThat(testPage.getTitle()).isEqualTo(getEnMessage("provider-response-confirmation-code.title"));
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();

// response
Expand Down Expand Up @@ -1303,7 +1296,6 @@ private void createAValidLink() {

private void submitFamilyConfirmationCode(){
testPage.navigateToFlowScreen("providerresponse/confirmation-code");
testPage.enter("providerResponseFamilyShortCode", CONF_CODE);
testPage.clickContinue();
}
}

0 comments on commit 81be535

Please sign in to comment.