Skip to content

Commit 06c5493

Browse files
author
Sandeep Singh
authored
Merge pull request #163 from alphagov/GOVSI-519-interruption-screen-for-terms-and-conds-update
Govsi 519 interruption screen for terms and conds update
2 parents f99f41d + 5d77eb8 commit 06c5493

31 files changed

Lines changed: 1033 additions & 491 deletions

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@
9595
"cheerio": "^1.0.0-rc.10",
9696
"copyfiles": "^2.4.1",
9797
"concurrently": "^6.2.0",
98+
"decache": "^4.6.0",
9899
"dotenv": "^10.0.0",
99100
"eslint": "^7.30.0",
100101
"eslint-config-prettier": "^8.3.0",

src/app.constants.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ export const PATH_NAMES = {
1313
LOG_IN_ENTER_PHONE_NUMBER: "/enter-phone-number",
1414
CHECK_YOUR_PHONE: "/check-your-phone",
1515
SHARE_INFO: "/share-info",
16+
UPDATED_TERMS_AND_CONDITIONS: "/updated-terms-and-conditions",
1617
ENTER_MFA: "/enter-code",
1718
SECURITY_CODE_EXPIRED: "/security-code-expired",
1819
AUTH_CODE: "/auth-code",
@@ -70,6 +71,7 @@ export const USER_STATE = {
7071
"PHONE_NUMBER_CODE_MAX_RETRIES_REACHED",
7172
MFA_CODE_SENT: "MFA_CODE_SENT",
7273
ADDED_CONSENT: "ADDED_CONSENT",
74+
UPDATED_TERMS_AND_CONDITIONS: "UPDATED_TERMS_AND_CONDITIONS",
7375
};
7476

7577
export enum NOTIFICATION_TYPE {

src/app.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ import { resendMfaCodeRouter } from "./components/resend-mfa-code/resend-mfa-cod
4242
import { signedOutRouter } from "./components/signed-out/signed-out-routes";
4343
import { getSessionIdMiddleware } from "./middleware/session-middleware";
4444
import { shareInfoRouter } from "./components/share-info/share-info-routes";
45+
import { updatedTermsCondsRouter } from "./components/updated-terms-conds/updated-terms-conds-routes";
4546

4647
const APP_VIEWS = [
4748
path.join(__dirname, "components"),
@@ -65,6 +66,7 @@ function registerRoutes(app: express.Application) {
6566
app.use(resendMfaCodeRouter);
6667
app.use(signedOutRouter);
6768
app.use(shareInfoRouter);
69+
app.use(updatedTermsCondsRouter);
6870
}
6971

7072
function createApp(): express.Application {

src/assets/scss/application.scss

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,36 @@
11
@use "../../../node_modules/govuk-frontend/govuk/all";
2+
3+
.interrupt-screen {
4+
background-color: #1d70b8;
5+
padding-top: 50px;
6+
padding-bottom: 50px;
7+
}
8+
9+
.govuk-white-text {
10+
color: #ffffff;
11+
}
12+
13+
.govuk-blue-text {
14+
color: #1d70b8;
15+
font-weight: bold;
16+
}
17+
18+
.govuk-white-button {
19+
background-color: #ffffff;
20+
}
21+
22+
.govuk-white-link {
23+
color: #ffffff;
24+
font-weight: bold;
25+
}
26+
27+
.govuk-btn-link {
28+
border: none;
29+
font-weight: bold;
30+
outline: none;
31+
background: none;
32+
cursor: pointer;
33+
color: #ffffff;
34+
box-shadow: 0px 1px #ffffff;
35+
padding: 0;
36+
}

src/components/check-your-phone/tests/check-your-phone-integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe } from "mocha";
33
import { expect, sinon } from "../../../../test/utils/test-utils";
44
import nock = require("nock");
55
import * as cheerio from "cheerio";
6-
import * as sessionMiddleware from "../../../middleware/session-middleware";
6+
import decache from "decache";
77

88
describe("Integration:: check your phone", () => {
99
let sandbox: sinon.SinonSandbox;
@@ -13,6 +13,9 @@ describe("Integration:: check your phone", () => {
1313
let baseApi: string;
1414

1515
before(() => {
16+
decache("../../../app");
17+
decache("../../../middleware/session-middleware");
18+
const sessionMiddleware = require("../../../middleware/session-middleware");
1619
sandbox = sinon.createSandbox();
1720
sandbox
1821
.stub(sessionMiddleware, "validateSessionMiddleware")

src/components/common/layout/base.njk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
}) }}
5454
{% block beforeContent %}{% endblock %}
5555
<main class="govuk-main-wrapper {{ mainClasses }}" id="main-content" role="main"{% if mainLang %} lang="{{ mainLang }}"{% endif %}>
56-
<div class="govuk-grid-row">
56+
<div class="govuk-grid-row {{ rowClasses }}">
5757
<div class="govuk-grid-column-two-thirds">
5858
{% block content %}{% endblock %}
5959
</div>

src/components/create-password/tests/create-password-integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { after, describe } from "mocha";
33
import { expect, sinon } from "../../../../test/utils/test-utils";
44
import nock = require("nock");
55
import * as cheerio from "cheerio";
6-
import * as sessionMiddleware from "../../../middleware/session-middleware";
6+
import decache from "decache";
77

88
describe("Integration::register create password", () => {
99
let sandbox: sinon.SinonSandbox;
@@ -13,6 +13,9 @@ describe("Integration::register create password", () => {
1313
let baseApi: string;
1414

1515
before(() => {
16+
decache("../../../app");
17+
decache("../../../middleware/session-middleware");
18+
const sessionMiddleware = require("../../../middleware/session-middleware");
1619
sandbox = sinon.createSandbox();
1720
sandbox
1821
.stub(sessionMiddleware, "validateSessionMiddleware")

src/components/enter-email/tests/enter-email-integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe } from "mocha";
33
import { expect, sinon } from "../../../../test/utils/test-utils";
44
import nock = require("nock");
55
import * as cheerio from "cheerio";
6-
import * as sessionMiddleware from "../../../middleware/session-middleware";
6+
import decache from "decache";
77

88
describe("Integration::enter email", () => {
99
let sandbox: sinon.SinonSandbox;
@@ -13,6 +13,9 @@ describe("Integration::enter email", () => {
1313
let baseApi: string;
1414

1515
before(() => {
16+
decache("../../../app");
17+
decache("../../../middleware/session-middleware");
18+
const sessionMiddleware = require("../../../middleware/session-middleware");
1619
sandbox = sinon.createSandbox();
1720
sandbox
1821
.stub(sessionMiddleware, "validateSessionMiddleware")

src/components/enter-mfa/tests/enter-mfa-integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { describe } from "mocha";
33
import { expect, sinon } from "../../../../test/utils/test-utils";
44
import nock = require("nock");
55
import * as cheerio from "cheerio";
6-
import * as sessionMiddleware from "../../../middleware/session-middleware";
6+
import decache from "decache";
77

88
describe("Integration:: enter mfa", () => {
99
let sandbox: sinon.SinonSandbox;
@@ -13,6 +13,9 @@ describe("Integration:: enter mfa", () => {
1313
let baseApi: string;
1414

1515
before(() => {
16+
decache("../../../app");
17+
decache("../../../middleware/session-middleware");
18+
const sessionMiddleware = require("../../../middleware/session-middleware");
1619
sandbox = sinon.createSandbox();
1720
sandbox
1821
.stub(sessionMiddleware, "validateSessionMiddleware")

src/components/enter-password/tests/enter-password-integration.test.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { describe } from "mocha";
33
import { expect, sinon } from "../../../../test/utils/test-utils";
44
import nock = require("nock");
55
import * as cheerio from "cheerio";
6-
import * as sessionMiddleware from "../../../middleware/session-middleware";
76
import { USER_STATE } from "../../../app.constants";
7+
import decache from "decache";
88

99
describe("Integration::enter password", () => {
1010
let sandbox: sinon.SinonSandbox;
@@ -16,6 +16,9 @@ describe("Integration::enter password", () => {
1616
const ENDPOINT = "/enter-password";
1717

1818
before(() => {
19+
decache("../../../app");
20+
decache("../../../middleware/session-middleware");
21+
const sessionMiddleware = require("../../../middleware/session-middleware");
1922
sandbox = sinon.createSandbox();
2023
sandbox
2124
.stub(sessionMiddleware, "validateSessionMiddleware")

0 commit comments

Comments
 (0)