From d0dc409de60cbfa5441e5498c88d069d93b06549 Mon Sep 17 00:00:00 2001 From: Taha Cherfia Date: Mon, 18 Nov 2024 16:05:36 +0100 Subject: [PATCH] test(chromium): update unit tests --- src/chromium/utils/tests/converter.utils.test.ts | 10 ++++++++-- src/chromium/utils/tests/screenshot.utils.test.ts | 8 +++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/chromium/utils/tests/converter.utils.test.ts b/src/chromium/utils/tests/converter.utils.test.ts index ef6fe2e1..e66552b0 100644 --- a/src/chromium/utils/tests/converter.utils.test.ts +++ b/src/chromium/utils/tests/converter.utils.test.ts @@ -439,9 +439,10 @@ describe('ConverterUtils', () => { downloadFrom: { url: 'http://example.com', extraHttpHeaders: { 'Content-Type': 'application/json' } - } + }, + generateDocumentOutline: true }); - expect(mockFormDataAppend).toHaveBeenCalledTimes(18); + expect(mockFormDataAppend).toHaveBeenCalledTimes(19); expect(data.append).toHaveBeenNthCalledWith( 1, 'pdfa', @@ -533,6 +534,11 @@ describe('ConverterUtils', () => { extraHttpHeaders: { 'Content-Type': 'application/json' } }) ); + expect(data.append).toHaveBeenNthCalledWith( + 19, + 'generateDocumentOutline', + 'true' + ); }); }); }); diff --git a/src/chromium/utils/tests/screenshot.utils.test.ts b/src/chromium/utils/tests/screenshot.utils.test.ts index 3da59613..6d713220 100644 --- a/src/chromium/utils/tests/screenshot.utils.test.ts +++ b/src/chromium/utils/tests/screenshot.utils.test.ts @@ -255,6 +255,7 @@ describe('ScreenshotUtils', () => { failOnResourceLoadingFailed: true, skipNetworkIdleEvent: false, failOnConsoleExceptions: true, + generateDocumentOutline: true, properties: { format: 'jpeg', quality: 50 @@ -268,7 +269,7 @@ describe('ScreenshotUtils', () => { extraHttpHeaders: { 'Content-Type': 'application/json' } } }); - expect(mockFormDataAppend).toHaveBeenCalledTimes(13); + expect(mockFormDataAppend).toHaveBeenCalledTimes(14); expect(data.append).toHaveBeenNthCalledWith( 1, 'emulatedMediaType', @@ -334,6 +335,11 @@ describe('ScreenshotUtils', () => { extraHttpHeaders: { 'Content-Type': 'application/json' } }) ); + expect(data.append).toHaveBeenNthCalledWith( + 14, + 'generateDocumentOutline', + 'true' + ); }); }); });