-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
AUT-3779: Add mobile "Account not found" page
- Loading branch information
Showing
8 changed files
with
214 additions
and
76 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
27 changes: 27 additions & 0 deletions
27
src/components/account-not-found/get-account-not-found-template.ts
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,27 @@ | ||
import { | ||
SERVICE_TYPE, | ||
WEB_TO_MOBILE_TEMPLATE_MAPPINGS, | ||
} from "../../app.constants"; | ||
import { getChannelSpecificTemplate } from "../../utils/get-channel-specific-template"; | ||
|
||
export function getAccountNotFoundTemplate( | ||
isOneLoginService: boolean, | ||
serviceType: string, | ||
isStrategicAppChannel: boolean | ||
): string { | ||
let webTemplate; | ||
|
||
if (isOneLoginService === true) { | ||
webTemplate = "account-not-found/index-one-login.njk"; | ||
} else if (serviceType === SERVICE_TYPE.OPTIONAL) { | ||
webTemplate = "account-not-found/index-optional.njk"; | ||
} else { | ||
webTemplate = "account-not-found/index-mandatory.njk"; | ||
} | ||
|
||
return getChannelSpecificTemplate( | ||
webTemplate, | ||
isStrategicAppChannel, | ||
WEB_TO_MOBILE_TEMPLATE_MAPPINGS | ||
); | ||
} |
16 changes: 0 additions & 16 deletions
16
src/components/account-not-found/get-account-not-found-web-template.ts
This file was deleted.
Oops, something went wrong.
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,32 @@ | ||
{% extends "common/layout/base.njk" %} | ||
{% from "govuk/components/button/macro.njk" import govukButton %} | ||
{% from "govuk/components/inset-text/macro.njk" import govukInsetText %} | ||
{% set showBack = true %} | ||
{% set hrefBack = 'enter-email' %} | ||
{% set pageTitleName = 'mobileAppPages.accountNotFound.title' | translate %} | ||
|
||
{% block content %} | ||
|
||
{% include "common/errors/errorSummary.njk" %} | ||
|
||
<h1 class="govuk-heading-l govuk-!-margin-top-0 govuk-!-margin-bottom-3">{{ 'mobileAppPages.accountNotFound.header' | translate }}</h1> | ||
|
||
<p class="govuk-body"> | ||
{{ 'mobileAppPages.accountNotFound.paragraph1' | translate }} | ||
<span class="govuk-body govuk-!-font-weight-bold">{{ email }}</span>. | ||
</p> | ||
|
||
<p class="govuk-body">{{ 'mobileAppPages.accountNotFound.paragraph2' | translate }}</p> | ||
|
||
<p class="govuk-body"> | ||
<a href="/enter-email" class="govuk-link" | ||
rel="noreferrer noopener">{{ 'mobileAppPages.accountNotFound.tryAnotherLinkText' | translate }}</a> | ||
</p> | ||
|
||
<p class="govuk-body"> | ||
<a href="https://www.gov.uk/using-your-gov-uk-one-login" class="govuk-link" | ||
rel="noreferrer noopener">{{ 'mobileAppPages.accountNotFound.findOutMoreLinkText' | translate }}</a> | ||
</p> | ||
|
||
{{ ga4OnPageLoad({ nonce: scriptNonce, statusCode: "200", englishPageTitle: pageTitleName, taxonomyLevel1: "authentication", taxonomyLevel2: "sign in", contentId: "10e1b70b-e208-4db8-8863-3679a675b51d", loggedInStatus: false, dynamic: false }) }} | ||
{% endblock %} |
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
62 changes: 62 additions & 0 deletions
62
src/components/account-not-found/tests/get-account-not-found-template.test.ts
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,62 @@ | ||
import { expect } from "chai"; | ||
import { describe } from "mocha"; | ||
import { getAccountNotFoundTemplate } from "../get-account-not-found-template"; | ||
import { SERVICE_TYPE } from "../../../app.constants"; | ||
|
||
describe("getAccountNotFoundWebTemplate", () => { | ||
describe("when isStrategicApp is false", () => { | ||
describe("when isOneLoginService is true", () => { | ||
it("should always return 'account-not-found/index-one-login.njk'", () => { | ||
[SERVICE_TYPE.OPTIONAL, SERVICE_TYPE.MANDATORY].forEach((i) => { | ||
expect(getAccountNotFoundTemplate(true, i, false)).to.equal( | ||
"account-not-found/index-one-login.njk" | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("when isOneLoginService is false", () => { | ||
it("should return 'account-not-found/index-optional.njk' when serviceType is equal to SERVICE_TYPE.OPTIONAL", () => { | ||
expect( | ||
getAccountNotFoundTemplate(false, SERVICE_TYPE.OPTIONAL, false) | ||
).to.equal("account-not-found/index-optional.njk"); | ||
}); | ||
|
||
it("should return 'account-not-found/index-mandatory.njk' when serviceType is not equal to SERVICE_TYPE.OPTIONAL", () => { | ||
[SERVICE_TYPE.MANDATORY, ""].forEach((i) => { | ||
expect(getAccountNotFoundTemplate(false, i, false)).to.equal( | ||
"account-not-found/index-mandatory.njk" | ||
); | ||
}); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("when isStrategicApp is true", () => { | ||
describe("when isOneLoginService is true", () => { | ||
it("should always return 'account-not-found/index-mobile.njk'", () => { | ||
[SERVICE_TYPE.OPTIONAL, SERVICE_TYPE.MANDATORY].forEach((i) => { | ||
expect(getAccountNotFoundTemplate(true, i, true)).to.equal( | ||
"account-not-found/index-mobile.njk" | ||
); | ||
}); | ||
}); | ||
}); | ||
|
||
describe("when isOneLoginService is false", () => { | ||
it("should return 'account-not-found/index-mobile.njk' when serviceType is equal to SERVICE_TYPE.OPTIONAL", () => { | ||
expect( | ||
getAccountNotFoundTemplate(false, SERVICE_TYPE.OPTIONAL, true) | ||
).to.equal("account-not-found/index-mobile.njk"); | ||
}); | ||
|
||
it("should return 'account-not-found/index-mobile.njk' when serviceType is not equal to SERVICE_TYPE.OPTIONAL", () => { | ||
[SERVICE_TYPE.MANDATORY, ""].forEach((i) => { | ||
expect(getAccountNotFoundTemplate(false, i, true)).to.equal( | ||
"account-not-found/index-mobile.njk" | ||
); | ||
}); | ||
}); | ||
}); | ||
}); | ||
}); |
32 changes: 0 additions & 32 deletions
32
src/components/account-not-found/tests/get-account-not-found-web-template.test.ts
This file was deleted.
Oops, something went wrong.