diff --git a/tests/pdf_snapshots/long_comment.pdf b/tests/pdf_snapshots/long_comment.pdf index b961102..d97bde9 100644 Binary files a/tests/pdf_snapshots/long_comment.pdf and b/tests/pdf_snapshots/long_comment.pdf differ diff --git a/tests/pdf_snapshots/medium_comment.pdf b/tests/pdf_snapshots/medium_comment.pdf index f9ffe08..a28de64 100644 Binary files a/tests/pdf_snapshots/medium_comment.pdf and b/tests/pdf_snapshots/medium_comment.pdf differ diff --git a/tests/pdf_snapshots/short_comment.pdf b/tests/pdf_snapshots/short_comment.pdf index 382671d..d18277f 100644 Binary files a/tests/pdf_snapshots/short_comment.pdf and b/tests/pdf_snapshots/short_comment.pdf differ diff --git a/tests/snapshot_helper.ts b/tests/snapshot_helper.ts index 3091745..5ae8136 100644 --- a/tests/snapshot_helper.ts +++ b/tests/snapshot_helper.ts @@ -3,7 +3,7 @@ import { DocController, FlatSurvey, IDocOptions, IPdfBrick } from '../src/entrie import { SurveyPDFTester, TestHelper } from '../src/helper_test'; import { SurveyPDF } from '../src/survey'; import { readFileSync, writeFileSync } from 'fs'; - +import jsPDF from 'jspdf'; interface IPDFSnapshotOptions { snapshotName: string; controllerOptions?: IDocOptions; @@ -11,6 +11,8 @@ interface IPDFSnapshotOptions { } export async function checkPDFSnapshot(surveyJSON: any, snapshotOptions: IPDFSnapshotOptions): Promise { + const jsPdfVersion = jsPDF.version; + jsPDF.version = 'test'; const survey = new SurveyPDFTester(surveyJSON, snapshotOptions.controllerOptions ?? TestHelper.defaultOptions); snapshotOptions.onSurveyCreated && snapshotOptions.onSurveyCreated(survey); survey.onDocControllerCreated.add((_, options) => { @@ -26,6 +28,7 @@ export async function checkPDFSnapshot(surveyJSON: any, snapshotOptions: IPDFSna const expected = readFileSync(fileName); expect(actual, `snapshot: "${snapshotName}" did not match`, { showMatcherMessage: false }).toEqual(expected); } + jsPDF.version = jsPdfVersion; } interface IFlatSnaphotOptions {