Skip to content

Commit d3d06ac

Browse files
committed
Fix test data
1 parent 59b9129 commit d3d06ac

11 files changed

+29
-0
lines changed

internal/events/src/events/__tests__/event-envelope.test.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,15 @@ describe("EventEnvelope schema validation", () => {
88
const baseValidEnvelope: Envelope = {
99
dataschema:
1010
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/order.READ.1.0.0.schema.json",
11+
dataschemaversion: "1.0.0",
1112
specversion: "1.0",
1213
id: "6f1c2a53-3d54-4a0a-9a0b-0e9ae2d4c111",
1314
source: "/data-plane/supplier-api/ordering",
1415
subject: "order/769acdd4",
1516
type: "uk.nhs.notify.supplier-api.order.READ.v1",
17+
plane: "data-plane",
1618
time: "2025-10-01T10:15:30.000Z",
19+
datacontenttype: "application/json",
1720
data: {
1821
"notify-payload": {
1922
"notify-data": { nhsNumber: "9434765919" },
@@ -241,10 +244,13 @@ describe("EventEnvelope schema validation", () => {
241244
specversion: "1.0" as const,
242245
id: "6f1c2a53-3d54-4a0a-9a0b-0e02b2c3d479",
243246
type: "uk.nhs.notify.supplier-api.letter.CREATED.v1" as const,
247+
plane: "data-plane",
244248
dataschema:
245249
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.CREATED.1.0.0.schema.json",
250+
dataschemaversion: "1.0.0",
246251
source: "/data-plane/supplier-api/letters",
247252
time: "2025-10-01T10:15:30.000Z",
253+
datacontenttype: "application/json",
248254
data: { status: "CREATED" },
249255
traceparent: "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
250256
recordedtime: "2025-10-01T10:15:30.250Z",
@@ -294,11 +300,14 @@ describe("EventEnvelope schema validation", () => {
294300
specversion: "1.0" as const,
295301
id: "6f1c2a53-3d54-4a0a-9a0b-0e9ae2d4c111",
296302
type: "uk.nhs.notify.supplier-api.order.READ.v1" as const,
303+
plane: "data-plane",
297304
dataschema:
298305
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/order.READ.1.0.0.schema.json",
306+
dataschemaversion: "1.0.0",
299307
source: "/data-plane/supplier-api/ordering",
300308
subject: "order/769acdd4",
301309
time: "2025-10-01T10:15:30.000Z",
310+
datacontenttype: "application/json",
302311
data: { status: "READ" },
303312
traceparent: "00-0af7651916cd43dd8448eb211c80319c-b7ad6b7169203331-01",
304313
recordedtime: "2025-10-01T10:15:30.250Z",

internal/events/src/events/__tests__/mi-events.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,15 @@ describe("MI event validations", () => {
1818
expect(event).toEqual(
1919
expect.objectContaining({
2020
type: "uk.nhs.notify.supplier-api.mi.SUBMITTED.v1",
21+
plane: "data-plane",
2122
specversion: "1.0",
2223
source: "/data-plane/supplier-api/prod/submit-mi",
2324
id: "8f2c3b44-4e65-5b1b-a678-1f0bf3d4d222",
2425
time: "2025-11-16T10:30:00.000Z",
2526
datacontenttype: "application/json",
2627
dataschema:
2728
"https://notify.nhs.uk/cloudevents/schemas/supplier-api/mi.SUBMITTED.1.0.0.schema.json",
29+
dataschemaversion: "1.0.0",
2830
subject: "mi/mi-test-001",
2931
data: expect.objectContaining({
3032
id: "mi-test-001",

internal/events/src/events/__tests__/testData/letter.ACCEPTED-with-invalid-major-version.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
},
1414
"datacontenttype": "application/json",
1515
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.0.1.0.schema.json",
16+
"dataschemaversion": "1.0.0",
1617
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
18+
"plane": "data-plane",
1719
"recordedtime": "2025-08-28T08:45:00.000Z",
1820
"severitynumber": 2,
1921
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/letter.ACCEPTED-with-missing-fields.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
},
1313
"datacontenttype": "application/json",
1414
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.1.0.0.schema.json",
15+
"dataschemaversion": "1.0.0",
1516
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
17+
"plane": "data-plane",
1618
"recordedtime": "2025-08-28T08:45:00.000Z",
1719
"severitynumber": 2,
1820
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/letter.ACCEPTED.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
},
1414
"datacontenttype": "application/json",
1515
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.ACCEPTED.1.0.0.schema.json",
16+
"dataschemaversion": "1.0.0",
1617
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
18+
"plane": "data-plane",
1719
"recordedtime": "2025-08-28T08:45:00.000Z",
1820
"severitynumber": 2,
1921
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/letter.FORWARDED.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
},
1616
"datacontenttype": "application/json",
1717
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.FORWARDED.1.0.0.schema.json",
18+
"dataschemaversion": "1.0.0",
1819
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
20+
"plane": "data-plane",
1921
"recordedtime": "2025-08-28T08:45:00.000Z",
2022
"severitynumber": 2,
2123
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/letter.RETURNED.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
},
1616
"datacontenttype": "application/json",
1717
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/letter.RETURNED.1.0.0.schema.json",
18+
"dataschemaversion": "1.0.0",
1819
"id": "23f1f09c-a555-4d9b-8405-0b33490bc920",
20+
"plane": "data-plane",
1921
"recordedtime": "2025-08-28T08:45:00.000Z",
2022
"severitynumber": 2,
2123
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/mi.SUBMITTED-minimal.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@
1111
},
1212
"datacontenttype": "application/json",
1313
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/mi.SUBMITTED.1.0.0.schema.json",
14+
"dataschemaversion": "1.0.0",
1415
"id": "9a3d4c55-5f76-6c2c-b789-2f1cf4e5e333",
16+
"plane": "data-plane",
1517
"recordedtime": "2025-11-16T15:00:00.250Z",
1618
"severitynumber": 2,
1719
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/mi.SUBMITTED-with-invalid-major-version.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,9 @@
1313
},
1414
"datacontenttype": "application/json",
1515
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/mi.SUBMITTED.2.0.0.schema.json",
16+
"dataschemaversion": "1.0.0",
1617
"id": "8f2c3b44-4e65-5b1b-a678-1f0bf3d4d222",
18+
"plane": "data-plane",
1719
"recordedtime": "2025-11-16T10:30:00.250Z",
1820
"severitynumber": 2,
1921
"severitytext": "INFO",

internal/events/src/events/__tests__/testData/mi.SUBMITTED-with-missing-subject.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,9 @@
1010
},
1111
"datacontenttype": "application/json",
1212
"dataschema": "https://notify.nhs.uk/cloudevents/schemas/supplier-api/mi.SUBMITTED.1.0.0.schema.json",
13+
"dataschemaversion": "1.0.0",
1314
"id": "8f2c3b44-4e65-5b1b-a678-1f0bf3d4d222",
15+
"plane": "data-plane",
1416
"recordedtime": "2025-11-16T10:30:00.250Z",
1517
"severitynumber": 2,
1618
"severitytext": "INFO",

0 commit comments

Comments
 (0)