Skip to content

Commit

Permalink
Merge branch '10363-story' into 10363-test
Browse files Browse the repository at this point in the history
  • Loading branch information
John Cruz committed Sep 11, 2024
2 parents d32109d + 6331e43 commit c3df332
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ import {
MOCK_MINUTE_ENTRY,
STANDING_PRETRIAL_ORDER_ENTRY,
} from '@shared/test/mockDocketEntry';
import {
DownloadDocketEntryRequestType,
batchDownloadDocketEntriesInteractor,
} from '@web-api/business/useCases/document/batchDownloadDocketEntriesInteractor';
import { MOCK_CASE } from '@shared/test/mockCase';
import { applicationContext } from '../../../../../shared/src/business/test/createTestApplicationContext';
import { batchDownloadDocketEntriesInteractor } from '@web-api/business/useCases/document/batchDownloadDocketEntriesInteractor';
import {
mockDocketClerkUser,
mockPrivatePractitionerUser,
Expand All @@ -30,18 +33,19 @@ describe('batchDownloadDocketEntriesInteractor', () => {
STANDING_PRETRIAL_ORDER_ENTRY.docketEntryId,
];

let requestParams: {
clientConnectionId: string;
docketNumber: string;
documentsSelectedForDownload: string[];
printableDocketRecordFileId?: string;
};
let requestParams: DownloadDocketEntryRequestType;
const TEST_GUID = 'TEST_GUID';
const TEST_BATCH_INDEX = 1;

beforeEach(() => {
requestParams = {
clientConnectionId: mockClientConnectionId,
docketNumber: MOCK_CASE.docketNumber,
documentsSelectedForDownload: mockDocumentsSelectedForDownload,
index: TEST_BATCH_INDEX,
totalNumberOfBatches: 1,
totalNumberOfFiles: 0,
uuid: TEST_GUID,
};
applicationContext
.getPersistenceGateway()
Expand Down Expand Up @@ -173,7 +177,7 @@ describe('batchDownloadDocketEntriesInteractor', () => {
},
],
onProgress: expect.anything(),
outputZipName: '101-18, Test Petitioner.zip',
outputZipName: `${TEST_GUID}-${TEST_BATCH_INDEX} 101-18, Test Petitioner.zip`,
});
});

Expand Down Expand Up @@ -214,7 +218,7 @@ describe('batchDownloadDocketEntriesInteractor', () => {
},
],
onProgress: expect.anything(),
outputZipName: '101-18, Test Petitioner.zip',
outputZipName: `${TEST_GUID}-${TEST_BATCH_INDEX} 101-18, Test Petitioner.zip`,
});
});

Expand All @@ -231,8 +235,12 @@ describe('batchDownloadDocketEntriesInteractor', () => {
applicationContext: expect.anything(),
clientConnectionId: mockClientConnectionId,
message: {
action: 'batch_download_ready',
action: 'docket_entries_batch_download_ready',
caseFolder: '101-18, Test Petitioner',
index: TEST_BATCH_INDEX,
totalNumberOfBatches: 1,
url: MOCK_URL,
uuid: TEST_GUID,
},
userId: mockDocketClerkUser.userId,
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ const batchDownloadDocketEntriesHelper = async (
const { caseCaption, isSealed: isCaseSealed } = caseToBatch;
const caseTitle = Case.getCaseTitle(caseCaption);
const caseFolder = `${docketNumber}, ${caseTitle}`;
const zipName = `${uuid}-${batchIndex} ${caseFolder}.zip`;
const zipName = `${uuid}-${batchIndex} ${caseFolder}.zip`;
const documentsToZip: {
key: string;
filePathInZip: string;
Expand Down

0 comments on commit c3df332

Please sign in to comment.