Skip to content

Commit f9770c2

Browse files
CCM-10283: Fix e2e tests
1 parent f3d4607 commit f9770c2

File tree

3 files changed

+16
-12
lines changed

3 files changed

+16
-12
lines changed

tests/test-team/helpers/db/template-storage-helper.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,13 +267,14 @@ export class TemplateStorageHelper {
267267
async getLetterProofMetadata(
268268
bucket: string,
269269
prefix: string,
270+
supplier: string,
270271
templateId: string,
271272
version: string,
272273
ext: string
273274
) {
274275
return await this.getS3Metadata(
275276
bucket,
276-
`${prefix}/${templateId}/${version}.${ext}`
277+
`${prefix}/${supplier}/${templateId}/${version}.${ext}`
277278
);
278279
}
279280

tests/test-team/template-mgmt-e2e-tests/template-mgmt-letter-full.e2e.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ test.describe('letter complete e2e journey', () => {
154154
proofFilenames.map((filename) =>
155155
templateStorageHelper.getS3Metadata(
156156
process.env.TEMPLATES_QUARANTINE_BUCKET_NAME,
157-
`proofs/${template.id}/${filename}`
157+
`proofs/WTMMOCK/${template.id}/${filename}`
158158
)
159159
)
160160
);

tests/test-team/template-mgmt-e2e-tests/template-mgmt-proofing.e2e.spec.ts

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -57,18 +57,18 @@ test.describe('Letter Proofing', () => {
5757
`WTMMOCK/Outgoing/${process.env.SFTP_ENVIRONMENT}/proofs/${templateId}/proof-3.pdf`
5858
);
5959

60-
// invoke SFTP poll lambda
61-
await lambdaClient.send(
62-
new InvokeCommand({
63-
FunctionName: process.env.SFTP_POLL_LAMBDA_NAME,
64-
Payload: JSON.stringify({
65-
supplier: 'WTMMOCK',
66-
}),
67-
})
68-
);
69-
7060
// check for expected results
7161
await expect(async () => {
62+
// invoke SFTP poll lambda
63+
await lambdaClient.send(
64+
new InvokeCommand({
65+
FunctionName: process.env.SFTP_POLL_LAMBDA_NAME,
66+
Payload: JSON.stringify({
67+
supplier: 'WTMMOCK',
68+
}),
69+
})
70+
);
71+
7272
const template = await templateStorageHelper.getTemplate({
7373
owner: user.userId,
7474
id: templateId,
@@ -99,6 +99,7 @@ test.describe('Letter Proofing', () => {
9999
await templateStorageHelper.getLetterProofMetadata(
100100
process.env.TEMPLATES_QUARANTINE_BUCKET_NAME,
101101
'proofs',
102+
'WTMMOCK',
102103
templateId,
103104
fileName,
104105
'pdf'
@@ -177,6 +178,7 @@ test.describe('Letter Proofing', () => {
177178
expect(template.files?.proofs).toEqual({
178179
'proof.pdf': {
179180
fileName: `proof.pdf`,
181+
supplier: 'WTMMOCK',
180182
virusScanStatus: 'FAILED',
181183
},
182184
});
@@ -186,6 +188,7 @@ test.describe('Letter Proofing', () => {
186188
const pdf = await templateStorageHelper.getLetterProofMetadata(
187189
process.env.TEMPLATES_QUARANTINE_BUCKET_NAME,
188190
'proofs',
191+
'WTMMOCK',
189192
templateId,
190193
'proof',
191194
'pdf'

0 commit comments

Comments
 (0)