Skip to content

Commit adaaec1

Browse files
committed
CCM-9118 e2e test changes
1 parent c798e23 commit adaaec1

File tree

2 files changed

+43
-11
lines changed

2 files changed

+43
-11
lines changed

frontend/src/components/organisms/PreviewLetterTemplate/PreviewLetterTemplate.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export function PreviewLetterTemplate({
3535
text: submitText,
3636
href: `${basePath}/submit-letter-template/${template.id}`,
3737
},
38+
PROOF_AVAILABLE: {
39+
text: submitText,
40+
href: `${basePath}/submit-letter-template/${template.id}`,
41+
},
3842
PENDING_PROOF_REQUEST: {
3943
text: requestProofText,
4044
href: `${basePath}/request-proof-of-template/${template.id}`,

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

Lines changed: 39 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -112,16 +112,6 @@ test.describe('letter complete e2e journey', () => {
112112
);
113113
}).toPass({ timeout: 40_000 });
114114

115-
// invoke SFTP poll lambda
116-
await lambdaClient.send(
117-
new InvokeCommand({
118-
FunctionName: process.env.SFTP_POLL_LAMBDA_NAME,
119-
Payload: JSON.stringify({
120-
supplier: 'WTMMOCK',
121-
}),
122-
})
123-
);
124-
125115
await expect(async () => {
126116
await page.reload();
127117

@@ -138,8 +128,46 @@ test.describe('letter complete e2e journey', () => {
138128
await requestProofPage.clickRequestProofButton();
139129

140130
await expect(page).toHaveURL(TemplateMgmtPreviewLetterPage.urlRegexp);
131+
await expect(previewTemplatePage.continueButton).toBeHidden();
141132

142-
await previewTemplatePage.clickContinueButton();
133+
// invoke SFTP poll lambda
134+
await lambdaClient.send(
135+
new InvokeCommand({
136+
FunctionName: process.env.SFTP_POLL_LAMBDA_NAME,
137+
Payload: JSON.stringify({
138+
supplier: 'WTMMOCK',
139+
}),
140+
})
141+
);
142+
143+
await expect(async () => {
144+
const template = await templateStorageHelper.getTemplate(key);
145+
expect(template.files).toContain({ proofs: {} });
146+
147+
expect(template.files?.proofs).toEqual({
148+
'proof-1': {
149+
fileName: `proofs/${user.userId}/${templateId}/proof-1.pdf`,
150+
virusScanStatus: 'PASSED',
151+
},
152+
'proof-2': {
153+
fileName: `proofs/${user.userId}/${templateId}/proof-2.pdf`,
154+
virusScanStatus: 'PASSED',
155+
},
156+
'proof-3': {
157+
fileName: `proofs/${user.userId}/${templateId}/proof-3.pdf`,
158+
virusScanStatus: 'PASSED',
159+
},
160+
});
161+
162+
expect(template.templateStatus).toEqual('PROOF_AVAILABLE');
163+
}).toPass({ timeout: 60_000 });
164+
165+
await expect(async () => {
166+
await page.reload();
167+
168+
await expect(previewTemplatePage.continueButton).toBeVisible();
169+
await previewTemplatePage.clickContinueButton();
170+
}).toPass({ timeout: 60_000 });
143171

144172
await expect(page).toHaveURL(TemplateMgmtSubmitLetterPage.urlRegexp);
145173

0 commit comments

Comments
 (0)