Skip to content

Commit 546ea26

Browse files
SB Reformatting which has somehow not happened.
1 parent be31e5f commit 546ea26

File tree

3 files changed

+13
-19
lines changed

3 files changed

+13
-19
lines changed

e2e/general/appNotLoggedIn.spec.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
1-
import { getEnv } from "@project/e2e/helpers";
21
import { expect, test } from "@playwright/test";
32
import { HUB_PAGE_URL } from "@project/e2e/constants";
3+
import { getEnv } from "@project/e2e/helpers";
44

55
test.describe.configure({ mode: "serial" });
66

77
test.describe("E2E", () => {
8-
98
test.beforeAll(async ({ browser }, testInfo) => {
109
testInfo.setTimeout(60_000);
1110
});
1211

13-
test("Not logged in user is directed", async ({page}) => {
14-
const expectedUrl = getEnv("NHS_APP_REDIRECT_LOGIN_URL")
12+
test("Not logged in user is directed", async ({ page }) => {
13+
const expectedUrl = getEnv("NHS_APP_REDIRECT_LOGIN_URL");
1514

16-
await page.goto(HUB_PAGE_URL)
15+
await page.goto(HUB_PAGE_URL);
1716

18-
await expect(page.url()).toBe(expectedUrl)
17+
await expect(page.url()).toBe(expectedUrl);
1918
});
2019
});

src/services/content-api/gateway/content-reader-service.test.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
import { S3Client } from "@aws-sdk/client-s3";
55
import mockRsvVaccineJson from "@project/wiremock/__files/rsv-vaccine.json";
66
import { VaccineTypes } from "@src/models/vaccine";
7-
import { _readContentFromCache,
8-
getContentForVaccine } from "@src/services/content-api/gateway/content-reader-service";
7+
import { _readContentFromCache, getContentForVaccine } from "@src/services/content-api/gateway/content-reader-service";
98
import { ContentErrorTypes, GetContentForVaccineResponse } from "@src/services/content-api/types";
109
import { configProvider } from "@src/utils/config";
1110
import { Readable } from "stream";

src/services/content-api/gateway/content-reader-service.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,39 +3,35 @@
33
import { GetObjectCommand, S3Client, S3ServiceException } from "@aws-sdk/client-s3";
44
import { VaccineTypes } from "@src/models/vaccine";
55
import { VaccineContentPaths, vaccineTypeToPath } from "@src/services/content-api/constants";
6+
import { ReadingS3Error, S3HttpStatusError, S3NoSuchKeyError } from "@src/services/content-api/gateway/exceptions";
67
import { getFilteredContentForVaccine } from "@src/services/content-api/parsers/content-filter-service";
78
import { getStyledContentForVaccine } from "@src/services/content-api/parsers/content-styling-service";
89
import {
910
ContentErrorTypes,
1011
GetContentForVaccineResponse,
1112
StyledVaccineContent,
12-
VaccinePageContent
13+
VaccinePageContent,
1314
} from "@src/services/content-api/types";
1415
import { AppConfig, configProvider } from "@src/utils/config";
1516
import { AWS_PRIMARY_REGION } from "@src/utils/constants";
1617
import { logger } from "@src/utils/logger";
1718
import { S3_PREFIX, isS3Path } from "@src/utils/path";
19+
import { HttpStatusCode } from "axios";
1820
import { readFile } from "node:fs/promises";
1921
import { Logger } from "pino";
2022
import { Readable } from "stream";
21-
import {
22-
ReadingS3Error,
23-
S3NoSuchKeyError,
24-
S3HttpStatusError,
25-
} from "@src/services/content-api/gateway/exceptions";
26-
import { HttpStatusCode } from "axios";
2723

2824
const log: Logger = logger.child({ module: "content-reader-service" });
2925

3026
const _readFileS3 = async (bucket: string, key: string): Promise<string> => {
3127
try {
3228
const s3Client: S3Client = new S3Client({
33-
region: AWS_PRIMARY_REGION
29+
region: AWS_PRIMARY_REGION,
3430
});
3531

3632
const getObjectCommand: GetObjectCommand = new GetObjectCommand({
3733
Bucket: bucket,
38-
Key: key
34+
Key: key,
3935
});
4036
const { Body } = await s3Client.send(getObjectCommand);
4137

@@ -95,13 +91,13 @@ const getContentForVaccine = async (vaccineType: VaccineTypes): Promise<GetConte
9591
if (error instanceof ReadingS3Error) {
9692
return {
9793
styledVaccineContent: undefined,
98-
contentError: ContentErrorTypes.CONTENT_LOADING_ERROR
94+
contentError: ContentErrorTypes.CONTENT_LOADING_ERROR,
9995
};
10096
} else {
10197
log.error(error, `Error getting content for vaccine: ${vaccineType}`);
10298
return {
10399
styledVaccineContent: undefined,
104-
contentError: ContentErrorTypes.CONTENT_LOADING_ERROR
100+
contentError: ContentErrorTypes.CONTENT_LOADING_ERROR,
105101
};
106102
}
107103
}

0 commit comments

Comments
 (0)