Skip to content

Commit a16e1df

Browse files
tests - manual fixes
1 parent 3ec412e commit a16e1df

4 files changed

Lines changed: 10 additions & 32 deletions

File tree

tests/component-tests/apiGateway-tests/testCases/create-mi.ts

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ export type MiRequestBody = {
1313
};
1414

1515
export function miValidRequest(): MiRequestBody {
16-
let requestBody: MiRequestBody;
17-
18-
requestBody = {
16+
return {
1917
data: {
2018
attributes: {
2119
groupId: "group123",
@@ -28,13 +26,10 @@ export function miValidRequest(): MiRequestBody {
2826
type: "ManagementInformation",
2927
},
3028
};
31-
return requestBody;
3229
}
3330

3431
export function miInvalidRequest(): MiRequestBody {
35-
let requestBody: MiRequestBody;
36-
37-
requestBody = {
32+
return {
3833
data: {
3934
attributes: {
4035
groupId: "group123",
@@ -47,13 +42,10 @@ export function miInvalidRequest(): MiRequestBody {
4742
type: "?",
4843
},
4944
};
50-
return requestBody;
5145
}
5246

5347
export function miInvalidDateRequest(): MiRequestBody {
54-
let requestBody: MiRequestBody;
55-
56-
requestBody = {
48+
return {
5749
data: {
5850
attributes: {
5951
groupId: "group123",
@@ -66,5 +58,4 @@ export function miInvalidDateRequest(): MiRequestBody {
6658
type: "ManagementInformation",
6759
},
6860
};
69-
return requestBody;
7061
}

tests/component-tests/apiGateway-tests/testCases/update-letter-status.ts

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -29,23 +29,19 @@ export type PatchMessageResponseBody = {
2929
};
3030

3131
export function patchRequestHeaders(): RequestHeaders {
32-
let requestHeaders: RequestHeaders;
33-
requestHeaders = {
32+
return {
3433
headerauth1: process.env.HEADERAUTH || "",
3534
"NHSD-Supplier-ID": SUPPLIERID,
3635
"NHSD-Correlation-ID": "12344",
3736
"X-Request-ID": "requestId1",
3837
};
39-
return requestHeaders;
4038
}
4139

4240
export function patchValidRequestBody(
4341
id: string,
4442
status: string,
4543
): PatchMessageRequestBody {
46-
let requestBody: PatchMessageRequestBody;
47-
48-
requestBody = {
44+
return {
4945
data: {
5046
attributes: {
5147
status,
@@ -54,16 +50,13 @@ export function patchValidRequestBody(
5450
id,
5551
},
5652
};
57-
return requestBody;
5853
}
5954

6055
export function patchFailureRequestBody(
6156
id: string,
6257
status: string,
6358
): PatchMessageRequestBody {
64-
let requestBody: PatchMessageRequestBody;
65-
66-
requestBody = {
59+
return {
6760
data: {
6861
attributes: {
6962
status,
@@ -74,12 +67,10 @@ export function patchFailureRequestBody(
7467
id,
7568
},
7669
};
77-
return requestBody;
7870
}
7971

8072
export function patch400ErrorResponseBody(): ErrorMessageBody {
81-
let responseBody: ErrorMessageBody;
82-
responseBody = {
73+
return {
8374
errors: [
8475
{
8576
id: "12344",
@@ -94,12 +85,10 @@ export function patch400ErrorResponseBody(): ErrorMessageBody {
9485
},
9586
],
9687
};
97-
return responseBody;
9888
}
9989

10090
export function patch500ErrorResponseBody(id: string): ErrorMessageBody {
101-
let responseBody: ErrorMessageBody;
102-
responseBody = {
91+
return {
10392
errors: [
10493
{
10594
id: "12344",
@@ -114,5 +103,4 @@ export function patch500ErrorResponseBody(id: string): ErrorMessageBody {
114103
},
115104
],
116105
};
117-
return responseBody;
118106
}

tests/config/reporters.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import type { ReporterDescription } from "@playwright/test";
22
import path from "node:path";
33

44
const resultsDir = process.env.RESULTS_DIR || "results";
5-
const reportsDir = process.env.REPORTS_DIR || "reports";
65

76
export function getReporters(allureFolder: string) {
87
return [

tests/helpers/pnpm-helpers.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ export async function runCreateLetter(options: {
6969
child.stdout?.on("id", (id) => {
7070
const text = id.toString();
7171
output += text;
72-
process.stdout.write(text);
72+
process.stdout.write(output);
7373
});
7474

7575
child.on("close", (code) =>
@@ -127,7 +127,7 @@ export async function createSupplierData(options: {
127127
child.stdout?.on("id", (id) => {
128128
const text = id.toString();
129129
output += text;
130-
process.stdout.write(text);
130+
process.stdout.write(output);
131131
});
132132

133133
child.on("close", (code) =>

0 commit comments

Comments
 (0)