-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into DAH-3122-log-translate-api-usage
- Loading branch information
Showing
28 changed files
with
325 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -647,6 +647,17 @@ | |
$translate('page_title.listing_application', {listing: listing.Name}) | ||
] | ||
}) | ||
.state('dahlia.short-form-application.dalp-screening', { | ||
url: '/dalp-screening' | ||
params: | ||
skipConfirm: { squash: true, value: false } | ||
views: | ||
'container@': | ||
templateUrl: 'short-form/templates/layout.html' | ||
controller: 'ShortFormApplicationController' | ||
'[email protected]': | ||
templateUrl: 'short-form/templates/a4a-dalp-screening.html' | ||
}) | ||
# Short form: "You" section | ||
.state('dahlia.short-form-application.prerequisites', { | ||
url: '/prerequisites' | ||
|
@@ -657,8 +668,10 @@ | |
infoChanged: | ||
squash: true | ||
onEnter: [ | ||
'$stateParams', 'ShortFormApplicationService', 'AccountService', 'AutosaveService' | ||
($stateParams, ShortFormApplicationService, AccountService, AutosaveService) -> | ||
'$state', '$stateParams', 'ShortFormApplicationService', 'AccountService', 'AutosaveService' | ||
($state, $stateParams, ShortFormApplicationService, AccountService, AutosaveService) -> | ||
if ShortFormApplicationService.listingIsDalp() && !ShortFormApplicationService.application.answeredDalpScreening | ||
$state.go('dahlia.short-form-application.dalp-screening', {id: $stateParams.id, skipConfirm: true, lang: $stateParams.lang}) | ||
# If applicant tries to go to this page on a rental listing, redirect them back to homepage | ||
if !ShortFormApplicationService.listingIsSale() | ||
$state.go('dahlia.welcome') | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletions
24
app/assets/javascripts/short-form/templates/a4a-dalp-screening.html.slim
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
section.app-container.focus-container | ||
.app-card.form-card | ||
short-form-header | ||
h2.app-card_question | ||
| {{ 'a3a_dalp_screening.title' | translate }} | ||
|
||
.app-inner.inset | ||
.form-group | ||
p.form-note.margin-bottom translate="label.please_select_all_that_apply" | ||
.checkbox | ||
input#dalp_educator name="dalp_educator" type="checkbox" ngchange="onSelectDalpEducator()" ng-model="application.dalpEducator" | ||
label for="dalp_educator" Dalp educator | ||
| {{ application.dalpEducator }} | ||
.form-group.margin-left--2x.margin-right--2x.margin-bottom--2x ng-if="application.dalpEducator" | ||
file-uploader button-label="Upload Paystub" file-label="Paystub" document="application.documents['Dalp educator proof']" file-type="Paystub" required="true" | ||
.checkbox | ||
input#dalp_first_responder name="dalp_first_responder" type="checkbox" ng-model="application.dalpFirstResponder" | ||
label for="dalp_first_responder" Dalp first responder | ||
| {{ application.dalpFirstResponder }} | ||
.form-group.margin-left--2x.margin-right--2x.margin-bottom--2x ng-if="application.dalpFirstResponder" | ||
file-uploader button-label="Upload Pay Stub" file-label="Paystub" document="application.documents['Dalp first responder proof']" file-type="Paystub with employer address" required="true" | ||
.button-pager | ||
.button-pager_row.primary.text-center | ||
input#submit.button.primary.radius type="submit" value="{{'t.next' | translate}}" ng-disabled="eligibilityErrors.length > 0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -641,7 +641,7 @@ exports[`<AccountSettingsPage /> when the user is signed in resize events 1`] = | |
</div> | ||
<a | ||
class="seeds-link forgot-password-link" | ||
href="/forgot-password" | ||
href="/forgot-password[email protected]" | ||
> | ||
Forgot password? | ||
</a> | ||
|
@@ -1506,7 +1506,7 @@ exports[`<AccountSettingsPage /> when the user is signed in resize events 1`] = | |
</div> | ||
<a | ||
class="seeds-link forgot-password-link" | ||
href="/forgot-password" | ||
href="/forgot-password[email protected]" | ||
> | ||
Forgot password? | ||
</a> | ||
|
@@ -2404,7 +2404,7 @@ exports[`<AccountSettingsPage /> when the user is signed in resize events 2`] = | |
</div> | ||
<a | ||
class="seeds-link forgot-password-link" | ||
href="/forgot-password" | ||
href="/forgot-password[email protected]" | ||
> | ||
Forgot password? | ||
</a> | ||
|
@@ -3245,7 +3245,7 @@ exports[`<AccountSettingsPage /> when the user is signed in resize events 2`] = | |
</div> | ||
<a | ||
class="seeds-link forgot-password-link" | ||
href="/forgot-password" | ||
href="/forgot-password[email protected]" | ||
> | ||
Forgot password? | ||
</a> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -266,6 +266,12 @@ describe("<AccountSettingsPage />", () => { | |
name: /email/i, | ||
}) | ||
|
||
expect( | ||
screen.getByRole("link", { | ||
name: /forgot password\?/i, | ||
}) | ||
).toHaveAttribute("href", "/[email protected]") | ||
|
||
const emailField = within(group).getByRole("textbox") | ||
|
||
await act(async () => { | ||
|
@@ -308,6 +314,12 @@ describe("<AccountSettingsPage />", () => { | |
}), | ||
}) | ||
) | ||
|
||
expect( | ||
screen.getByRole("link", { | ||
name: /forgot password\?/i, | ||
}) | ||
).toHaveAttribute("href", "/[email protected]") | ||
}) | ||
|
||
it("does not update with malformed emails", async () => { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,4 +30,50 @@ describe("<ForgotPassword />", () => { | |
) | ||
).not.toBeNull() | ||
}) | ||
|
||
it("should extract the email parameter from the URL", async () => { | ||
const customLocation = { | ||
...window.location, | ||
search: "[email protected]", | ||
href: "http://dahlia.com", | ||
assign: jest.fn(), | ||
replace: jest.fn(), | ||
reload: jest.fn(), | ||
toString: jest.fn(), | ||
} | ||
|
||
Object.defineProperty(window, "location", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: customLocation, | ||
}) | ||
await renderAndLoadAsync(<ForgotPassword assetPaths={{}} />) | ||
|
||
const emailInput = screen.getByLabelText(/email/i) | ||
expect(emailInput).toHaveValue("[email protected]") | ||
}) | ||
|
||
it("should handle the absence of the email parameter", async () => { | ||
const customLocation = { | ||
...window.location, | ||
search: "", | ||
href: "http://dahlia.com", | ||
assign: jest.fn(), | ||
replace: jest.fn(), | ||
reload: jest.fn(), | ||
toString: jest.fn(), | ||
} | ||
|
||
Object.defineProperty(window, "location", { | ||
configurable: true, | ||
enumerable: true, | ||
writable: true, | ||
value: customLocation, | ||
}) | ||
await renderAndLoadAsync(<ForgotPassword assetPaths={{}} />) | ||
|
||
const emailInput = screen.getByLabelText(/email/i) | ||
expect(emailInput).toHaveValue("") | ||
}) | ||
}) |
Oops, something went wrong.