From 70f03596801e6b2a2b16cbe4defa978e22f3651e Mon Sep 17 00:00:00 2001 From: Ben Helleman Date: Tue, 24 Sep 2024 14:20:18 -0400 Subject: [PATCH] fix: SITES-25634 [Importer] Expose hasCustomImportJs and hasCustomHeaders as two new fields on a import job. --- .../test/unit/service/import-job/index.test.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/packages/spacecat-shared-data-access/test/unit/service/import-job/index.test.js b/packages/spacecat-shared-data-access/test/unit/service/import-job/index.test.js index e533eb9e..6ba32075 100644 --- a/packages/spacecat-shared-data-access/test/unit/service/import-job/index.test.js +++ b/packages/spacecat-shared-data-access/test/unit/service/import-job/index.test.js @@ -95,6 +95,14 @@ describe('Import Job Tests', () => { // expect that 2 results were in the db, and that the results were not modified expect(result).to.be.an('array').and.to.have.lengthOf(2); + + // verify that the mocked properties are present in the result + function hasPropertiesOf(mockJob, importJob) { + return Object.keys(mockJob).every((key) => mockJob[key] === importJob.state[key]); + } + + expect(hasPropertiesOf(mockImportJobs[0], result[0])).to.be.true; + expect(hasPropertiesOf(mockImportJobs[1], result[1])).to.be.true; }, ); });