Skip to content

Commit 014400a

Browse files
committed
fix: failing e2e tests due to pdf gen
1 parent c6089d5 commit 014400a

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/utils/convert-html-to-pdf.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { err, ok, ResultAsync } from 'neverthrow'
22
import puppeteer from 'puppeteer-core'
33

4-
import config, { aws as AwsConfig } from '../config/config'
4+
import config, { aws as AwsConfig, isTest } from '../config/config'
55
import { createLoggerWithLabel } from '../config/logger'
66
import {
77
PdfGenerationLambdaFailureError,
@@ -136,6 +136,12 @@ export const generatePdfFromHtml = async (
136136
summaryHtml: string,
137137
isUseLambdaOutput: boolean,
138138
): Promise<Buffer> => {
139+
// Required for e2e testing, since PDF is generated during submission.
140+
if (isTest) {
141+
const DUMMY_PDF_CONTENT = 'TEST PDF CONTENT'
142+
return Buffer.from(DUMMY_PDF_CONTENT)
143+
}
144+
139145
const logMeta = {
140146
action: 'generatePdfFromHtml',
141147
isUseLambdaOutput,

0 commit comments

Comments
 (0)