Skip to content

Commit dcfa54d

Browse files
CCM-11886: Fix unit tests
1 parent 766c170 commit dcfa54d

File tree

5 files changed

+32
-32
lines changed

5 files changed

+32
-32
lines changed

lambdas/event-publisher/src/__tests__/domain/event-builder.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const publishableEventRecord = (newStatus: string): PublishableEventRecord => ({
3535
S: 'client-id',
3636
},
3737
createdAt: {
38-
S: 'created-at',
38+
S: '2022-01-01T09:00:00.000Z',
3939
},
4040
createdBy: {
4141
S: 'created-by',
@@ -47,7 +47,7 @@ const publishableEventRecord = (newStatus: string): PublishableEventRecord => ({
4747
S: newStatus,
4848
},
4949
updatedAt: {
50-
S: 'updated-at',
50+
S: '2022-01-01T09:00:01.000Z',
5151
},
5252
updatedBy: {
5353
S: 'updated-by',
@@ -117,7 +117,7 @@ const publishableEventRecord = (newStatus: string): PublishableEventRecord => ({
117117
S: 'client-id',
118118
},
119119
createdAt: {
120-
S: 'created-at',
120+
S: '2022-01-01T09:00:00.000Z',
121121
},
122122
createdBy: {
123123
S: 'created-by',
@@ -129,7 +129,7 @@ const publishableEventRecord = (newStatus: string): PublishableEventRecord => ({
129129
S: 'PENDING_PROOF_REQUEST',
130130
},
131131
updatedAt: {
132-
S: 'updated-at',
132+
S: '2022-01-01T09:00:01.000Z',
133133
},
134134
updatedBy: {
135135
S: 'updated-by',
@@ -208,9 +208,9 @@ const expectedEvent = (status: string, type: string, dataschema: string) => ({
208208
owner: 'owner',
209209
id: '92b676e9-470f-4d04-ab14-965ef145e15d',
210210
clientId: 'client-id',
211-
createdAt: 'created-at',
211+
createdAt: '2022-01-01T09:00:00.000Z',
212212
createdBy: 'created-by',
213-
updatedAt: 'updated-at',
213+
updatedAt: '2022-01-01T09:00:01.000Z',
214214
updatedBy: 'updated-by',
215215
personalisationParameters: ['test'],
216216
templateType: 'LETTER',

packages/event-schemas/schemas/TemplateCompleted/v1.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"createdAt": {
121121
"description": "Timestamp for when the template was initially created",
122122
"type": "string",
123-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
123+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
124124
},
125125
"createdBy": {
126126
"description": "Unique identifier for the user that initially created the template",
@@ -151,7 +151,7 @@
151151
"updatedAt": {
152152
"description": "Timestamp for when the template was most recently updated",
153153
"type": "string",
154-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
154+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
155155
},
156156
"updatedBy": {
157157
"description": "Unique identifier for the user that most recently updated the template",
@@ -206,7 +206,7 @@
206206
"createdAt": {
207207
"description": "Timestamp for when the template was initially created",
208208
"type": "string",
209-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
209+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
210210
},
211211
"createdBy": {
212212
"description": "Unique identifier for the user that initially created the template",
@@ -237,7 +237,7 @@
237237
"updatedAt": {
238238
"description": "Timestamp for when the template was most recently updated",
239239
"type": "string",
240-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
240+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
241241
},
242242
"updatedBy": {
243243
"description": "Unique identifier for the user that most recently updated the template",
@@ -286,7 +286,7 @@
286286
"createdAt": {
287287
"description": "Timestamp for when the template was initially created",
288288
"type": "string",
289-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
289+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
290290
},
291291
"createdBy": {
292292
"description": "Unique identifier for the user that initially created the template",
@@ -317,7 +317,7 @@
317317
"updatedAt": {
318318
"description": "Timestamp for when the template was most recently updated",
319319
"type": "string",
320-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
320+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
321321
},
322322
"updatedBy": {
323323
"description": "Unique identifier for the user that most recently updated the template",
@@ -440,7 +440,7 @@
440440
"createdAt": {
441441
"description": "Timestamp for when the template was initially created",
442442
"type": "string",
443-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
443+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
444444
},
445445
"createdBy": {
446446
"description": "Unique identifier for the user that initially created the template",
@@ -471,7 +471,7 @@
471471
"updatedAt": {
472472
"description": "Timestamp for when the template was most recently updated",
473473
"type": "string",
474-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
474+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
475475
},
476476
"updatedBy": {
477477
"description": "Unique identifier for the user that most recently updated the template",

packages/event-schemas/schemas/TemplateDeleted/v1.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@
120120
"createdAt": {
121121
"description": "Timestamp for when the template was initially created",
122122
"type": "string",
123-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
123+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
124124
},
125125
"createdBy": {
126126
"description": "Unique identifier for the user that initially created the template",
@@ -151,7 +151,7 @@
151151
"updatedAt": {
152152
"description": "Timestamp for when the template was most recently updated",
153153
"type": "string",
154-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
154+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
155155
},
156156
"updatedBy": {
157157
"description": "Unique identifier for the user that most recently updated the template",
@@ -206,7 +206,7 @@
206206
"createdAt": {
207207
"description": "Timestamp for when the template was initially created",
208208
"type": "string",
209-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
209+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
210210
},
211211
"createdBy": {
212212
"description": "Unique identifier for the user that initially created the template",
@@ -237,7 +237,7 @@
237237
"updatedAt": {
238238
"description": "Timestamp for when the template was most recently updated",
239239
"type": "string",
240-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
240+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
241241
},
242242
"updatedBy": {
243243
"description": "Unique identifier for the user that most recently updated the template",
@@ -286,7 +286,7 @@
286286
"createdAt": {
287287
"description": "Timestamp for when the template was initially created",
288288
"type": "string",
289-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
289+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
290290
},
291291
"createdBy": {
292292
"description": "Unique identifier for the user that initially created the template",
@@ -317,7 +317,7 @@
317317
"updatedAt": {
318318
"description": "Timestamp for when the template was most recently updated",
319319
"type": "string",
320-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
320+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
321321
},
322322
"updatedBy": {
323323
"description": "Unique identifier for the user that most recently updated the template",
@@ -440,7 +440,7 @@
440440
"createdAt": {
441441
"description": "Timestamp for when the template was initially created",
442442
"type": "string",
443-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
443+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
444444
},
445445
"createdBy": {
446446
"description": "Unique identifier for the user that initially created the template",
@@ -471,7 +471,7 @@
471471
"updatedAt": {
472472
"description": "Timestamp for when the template was most recently updated",
473473
"type": "string",
474-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
474+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
475475
},
476476
"updatedBy": {
477477
"description": "Unique identifier for the user that most recently updated the template",

packages/event-schemas/schemas/TemplateDrafted/v1.json

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@
127127
"createdAt": {
128128
"description": "Timestamp for when the template was initially created",
129129
"type": "string",
130-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
130+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
131131
},
132132
"createdBy": {
133133
"description": "Unique identifier for the user that initially created the template",
@@ -158,7 +158,7 @@
158158
"updatedAt": {
159159
"description": "Timestamp for when the template was most recently updated",
160160
"type": "string",
161-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
161+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
162162
},
163163
"updatedBy": {
164164
"description": "Unique identifier for the user that most recently updated the template",
@@ -213,7 +213,7 @@
213213
"createdAt": {
214214
"description": "Timestamp for when the template was initially created",
215215
"type": "string",
216-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
216+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
217217
},
218218
"createdBy": {
219219
"description": "Unique identifier for the user that initially created the template",
@@ -244,7 +244,7 @@
244244
"updatedAt": {
245245
"description": "Timestamp for when the template was most recently updated",
246246
"type": "string",
247-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
247+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
248248
},
249249
"updatedBy": {
250250
"description": "Unique identifier for the user that most recently updated the template",
@@ -293,7 +293,7 @@
293293
"createdAt": {
294294
"description": "Timestamp for when the template was initially created",
295295
"type": "string",
296-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
296+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
297297
},
298298
"createdBy": {
299299
"description": "Unique identifier for the user that initially created the template",
@@ -324,7 +324,7 @@
324324
"updatedAt": {
325325
"description": "Timestamp for when the template was most recently updated",
326326
"type": "string",
327-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
327+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
328328
},
329329
"updatedBy": {
330330
"description": "Unique identifier for the user that most recently updated the template",
@@ -447,7 +447,7 @@
447447
"createdAt": {
448448
"description": "Timestamp for when the template was initially created",
449449
"type": "string",
450-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
450+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
451451
},
452452
"createdBy": {
453453
"description": "Unique identifier for the user that initially created the template",
@@ -478,7 +478,7 @@
478478
"updatedAt": {
479479
"description": "Timestamp for when the template was most recently updated",
480480
"type": "string",
481-
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}.\\d{3}Z$"
481+
"pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
482482
},
483483
"updatedBy": {
484484
"description": "Unique identifier for the user that most recently updated the template",

packages/event-schemas/src/template.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ const $TemplateEventV1BaseData = z.object({
6767
// informal ISO datetime
6868
createdAt: z
6969
.string()
70-
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/)
70+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/)
7171
.meta({
7272
description: 'Timestamp for when the template was initially created',
7373
}),
@@ -84,7 +84,7 @@ const $TemplateEventV1BaseData = z.object({
8484
// informal ISO datetime
8585
updatedAt: z
8686
.string()
87-
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}.\d{3}Z$/)
87+
.regex(/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/)
8888
.meta({
8989
description: 'Timestamp for when the template was most recently updated',
9090
}),

0 commit comments

Comments
 (0)