Skip to content

Commit 2d66ea1

Browse files
author
naman-contentstack
committed
fix: test cases
1 parent a0783c3 commit 2d66ea1

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

packages/contentstack-export/src/utils/export-config-handler.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import login from './basic-login';
1616
import { filter, includes } from 'lodash';
1717
import { ExportConfig } from '../types';
1818

19-
const setupConfig = async (exportCmdFlags: any, context: any): Promise<ExportConfig> => {
19+
const setupConfig = async (exportCmdFlags: any, context?: any): Promise<ExportConfig> => {
2020
// Set progress supported module FIRST, before any log calls
2121
// This ensures the logger respects the showConsoleLogs setting correctly
2222
configHandler.set('log.progressSupportedModule', 'export');

packages/contentstack-import/test/unit/import/modules/entries.test.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2196,8 +2196,10 @@ describe('EntriesImport', () => {
21962196
await entriesImport['publishEntries']({ cTUid: 'simple_ct', locale: 'en-us' });
21972197

21982198
expect(makeConcurrentCallStub.called).to.be.true;
2199-
// Should pass 1 entry with all publish details (serializePublishEntries aggregates them into one API call)
2200-
expect(makeConcurrentCallStub.getCall(0).args[0].apiContent).to.have.lengthOf(1);
2199+
// One entry per publish_details item, each carrying that item's locale
2200+
const apiContent = makeConcurrentCallStub.getCall(0).args[0].apiContent;
2201+
expect(apiContent).to.have.lengthOf(3);
2202+
expect(apiContent.map((e: any) => e.locale)).to.deep.equal(['en-us', 'en-us', 'fr-fr']);
22012203
});
22022204

22032205
it('should handle entries without publish details', async () => {

0 commit comments

Comments
 (0)