Skip to content

Commit 775291f

Browse files
committed
CCM-12616: More test fixing
1 parent c78c8ae commit 775291f

5 files changed

Lines changed: 21 additions & 17 deletions

File tree

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,9 @@
11
import { test as setup } from '@playwright/test';
2+
import { TEST_SENDERS } from 'constants/test-senders';
23
import senderRepository from 'helpers/sender-helpers';
3-
import { Sender } from 'utils';
4-
5-
const testSenders: Sender[] = [
6-
{
7-
senderId: 'test-sender-1',
8-
senderName: 'Test Sender 1',
9-
meshMailboxSenderId: 'test-mesh-sender-1',
10-
meshMailboxReportsId: 'test-mesh-reports-1',
11-
fallbackWaitTimeSeconds: 24 * 3600,
12-
},
13-
];
144

155
setup('Create senders', async () => {
16-
for (const sender of testSenders) {
6+
for (const sender of TEST_SENDERS) {
177
await senderRepository.putSender(sender);
188
}
199
});
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { Sender } from 'utils';
2+
3+
export const TEST_SENDERS: Sender[] = [
4+
{
5+
senderId: '72c58534-d07a-409f-8a45-53b677b0ffd0',
6+
senderName: 'Test Sender 1',
7+
meshMailboxSenderId: 'test-mesh-sender-1',
8+
meshMailboxReportsId: 'test-mesh-reports-1',
9+
fallbackWaitTimeSeconds: 24 * 3600,
10+
},
11+
];

tests/playwright/digital-letters-component-tests/mesh-poll-download.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,10 @@ import { downloadFromS3, uploadToS3 } from 'helpers/s3-helpers';
1414
import { expectMessageContainingString } from 'helpers/sqs-helpers';
1515
import { v4 as uuidv4 } from 'uuid';
1616
import messageMessageReceived from 'digital-letters-events/MESHInboxMessageReceived.js';
17+
import { TEST_SENDERS } from 'constants/test-senders';
1718

1819
test.describe('Digital Letters - MESH Poll and Download', () => {
19-
const senderId = 'test-sender-1';
20+
const { senderId } = TEST_SENDERS[0];
2021
const sendersMeshMailboxId = 'test-mesh-sender-1';
2122
const meshMailboxId = 'mock-mailbox';
2223

tests/playwright/digital-letters-component-tests/pdm-uploader.component.spec.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import expectToPassEventually from 'helpers/expectations';
1212
import { uploadToS3 } from 'helpers/s3-helpers';
1313
import { expectMessageContainingString, purgeQueue } from 'helpers/sqs-helpers';
1414
import { v4 as uuidv4 } from 'uuid';
15+
import { TEST_SENDERS } from 'constants/test-senders';
1516

1617
const pdmRequest = {
1718
resourceType: 'DocumentReference',
@@ -62,7 +63,7 @@ test.describe('Digital Letters - Upload to PDM', () => {
6263
const resourceKey = `test/${letterId}`;
6364
const messageUri = `s3://${LETTERS_S3_BUCKET_NAME}/${resourceKey}`;
6465
const messageReference = uuidv4();
65-
const senderId = 'test-sender-1';
66+
const { senderId } = TEST_SENDERS[0];
6667

6768
uploadToS3(JSON.stringify(pdmRequest), LETTERS_S3_BUCKET_NAME, resourceKey);
6869

@@ -114,7 +115,7 @@ test.describe('Digital Letters - Upload to PDM', () => {
114115
const resourceKey = `test/${letterId}`;
115116
const messageUri = `s3://${LETTERS_S3_BUCKET_NAME}/${resourceKey}`;
116117
const messageReference = uuidv4();
117-
const senderId = 'test-sender-1';
118+
const { senderId } = TEST_SENDERS[0];
118119
const invalidPdmRequest = {
119120
...pdmRequest,
120121
unexpectedField: 'I should not be here',
@@ -174,7 +175,7 @@ test.describe('Digital Letters - Upload to PDM', () => {
174175
const eventId = uuidv4();
175176
const messageUri = `not-a-valid-s3-uri`;
176177
const messageReference = uuidv4();
177-
const senderId = 'test-sender-1';
178+
const { senderId } = TEST_SENDERS[0];
178179

179180
await eventPublisher.sendEvents(
180181
[

tests/playwright/digital-letters-component-tests/ttl-create.component.spec.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { getTtl } from 'helpers/dynamodb-helpers';
77
import eventPublisher from 'helpers/event-bus-helpers';
88
import expectToPassEventually from 'helpers/expectations';
99
import { v4 as uuidv4 } from 'uuid';
10+
import { TEST_SENDERS } from 'constants/test-senders';
1011

1112
test.describe('Digital Letters - Create TTL', () => {
1213
test('should create TTL and publish item enqueued event following message downloaded event', async () => {
@@ -35,7 +36,7 @@ test.describe('Digital Letters - Create TTL', () => {
3536
data: {
3637
messageUri,
3738
messageReference: 'ref1',
38-
senderId: 'test-sender-1',
39+
senderId: TEST_SENDERS[0].senderId,
3940
},
4041
},
4142
],

0 commit comments

Comments
 (0)