Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
ac45fb0
Fixed error in Nuxt kickstarter apps
sunil-lakshman Oct 9, 2025
3bdc06f
Updated the Graphql Host for Kickstart Graphql app
sunil-lakshman Oct 10, 2025
88c3ce2
Merge branch 'development' into fix/dx-3622
sunil-lakshman Oct 10, 2025
40ab817
Updated package lock file
sunil-lakshman Oct 10, 2025
41643af
Merge pull request #2156 from contentstack/fix/dx-3622
sunil-lakshman Oct 10, 2025
91b7b38
Fix: Added Unit test cases for Assets module
cs-raj Oct 13, 2025
c0eea4e
Merge branch 'development' into tests/fix-assets
cs-raj Oct 13, 2025
3e15f53
Fix: Added Test cases for content-types
cs-raj Oct 13, 2025
27cff2e
Merge pull request #2159 from contentstack/tests/fix-assets
cs-raj Oct 13, 2025
3803931
Merge branch 'development' into tests/fix-content-types
cs-raj Oct 13, 2025
a87ef38
Merge pull request #2160 from contentstack/tests/fix-content-types
cs-raj Oct 13, 2025
f71523d
Added Test cases for global-fields
cs-raj Oct 13, 2025
909369e
Merge pull request #2158 from contentstack/staging
harshithad0703 Oct 13, 2025
5b0f518
Merge pull request #2163 from contentstack/test/global-fields
cs-raj Oct 13, 2025
9f3550e
Fix: Added Unit test cases for workflow module
cs-raj Oct 14, 2025
c590236
Fixed the failing test
cs-raj Oct 14, 2025
a47be65
update package-lock
harshithad0703 Oct 14, 2025
b776036
Merge pull request #2165 from contentstack/tests/workflows
cs-raj Oct 14, 2025
503075d
Merge branch 'development' into fix/back-merge
harshithad0703 Oct 14, 2025
8f215d3
Merge pull request #2167 from contentstack/fix/back-merge
harshithad0703 Oct 14, 2025
c19de5c
Merge branch development into fix/back-merge4
harshithad0703 Oct 14, 2025
b27dc27
update package-lock
harshithad0703 Oct 14, 2025
5749676
Merge pull request #2169 from contentstack/fix/back-merge4
harshithad0703 Oct 14, 2025
4ada993
Fix: Added test cases for Custom roles
cs-raj Oct 14, 2025
2f63a00
Merge branch 'development' into tests/custom-roles
cs-raj Oct 14, 2025
4bde38d
Merge pull request #2170 from contentstack/tests/custom-roles
cs-raj Oct 14, 2025
28a1940
enhance: update error logging
Oct 14, 2025
50b8a90
fix: Added Test cases for asset-helpers
cs-raj Oct 14, 2025
7acc5c2
Merge pull request #2173 from contentstack/tests/DX-3588-a
cs-raj Oct 14, 2025
f20b019
Fix: Added Tests for Taxonomies and Setup-branch
cs-raj Oct 14, 2025
1a18cd0
Fix: Updated the package to use rewire
cs-raj Oct 15, 2025
59705e5
Lock File update
cs-raj Oct 15, 2025
a7cf210
Merge pull request #2174 from contentstack/tests/DX-3588
cs-raj Oct 15, 2025
337e2c8
fix: Added Tests cases for marketplace module
cs-raj Oct 16, 2025
4b676ee
Added Additional Test cases
cs-raj Oct 16, 2025
6710b66
Merge branch 'development' into enhancement/DX-3639
Oct 16, 2025
df7293e
enh: increased log file size threshold from 1 MB to 5 MB and number o…
aman19K Oct 16, 2025
bde8a4f
Merge pull request #2171 from contentstack/enhancement/DX-3639
naman-contentstack Oct 16, 2025
cf70c07
Fixed formatting
cs-raj Oct 16, 2025
a680ca7
fix: formatting
aman19K Oct 16, 2025
0be4487
Merge branch 'development' into tests/DX-3594
cs-raj Oct 16, 2025
bed6713
Merge branch 'development' into enh/DX-3647
aman19K Oct 16, 2025
410202e
Merge pull request #2176 from contentstack/tests/DX-3594
cs-raj Oct 16, 2025
43da37d
Merge branch 'development' into enh/DX-3647
aman19K Oct 16, 2025
857e323
Merge pull request #2177 from contentstack/enh/DX-3647
aman19K Oct 16, 2025
52d5a35
fix: Added Unit Test cases for Labels
cs-raj Oct 17, 2025
56aba10
Merge pull request #2179 from contentstack/tests/DX-3594
cs-raj Oct 17, 2025
3d57ef1
fix: Added Unit Test cases for entries and fixed marketplace test cases
cs-raj Oct 22, 2025
e6db2ce
fix: Fixed marketplace tests
cs-raj Oct 23, 2025
6e4409f
Version bump
cs-raj Oct 23, 2025
08b7d6e
Merge pull request #2181 from contentstack/tests/DX-3595
cs-raj Oct 23, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 17 additions & 7 deletions .talismanrc
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
fileignoreconfig:
- filename: package-lock.json
checksum: 23c42f846dfb95e8516b980e4d65a1f6d97ce6bd2b483d14af1e182ff2598da9
checksum: ac70357dfebdab2dc91150b19062310c825e48adcec59b857161d80a844fd814
- filename: pnpm-lock.yaml
checksum: 4bfcc1a77f91a411e825884e375ef588dd16f2950ba0ec970f6a9b9a544fc0b6
checksum: 945d2620b53b3eb7964e07a9b92ad87f3d6bba42bf932794d1c347e113d0e0f4
- filename: packages/contentstack-import-setup/test/unit/backup-handler.test.ts
checksum: 0582d62b88834554cf12951c8690a73ef3ddbb78b82d2804d994cf4148e1ef93
- filename: packages/contentstack-import-setup/test/config.json
Expand Down Expand Up @@ -74,7 +74,7 @@ fileignoreconfig:
- filename: packages/contentstack-bootstrap/messages/index.json
checksum: c435ceaa709a7504da303a6ea674e07a89030d8ad4152e7917cd17e7f3e58052
- filename: packages/contentstack-bootstrap/src/config.ts
checksum: 65d300dc729fb84f5446c0b14921555db01fe5c90be3d297e3d0418a37b3696a
checksum: cc3270acd9d37479b24792f45a108e0f1c99265f92d59c35c0ec3ee2d1cc390d
- filename: packages/contentstack-clone/src/commands/cm/stacks/clone.js
checksum: 433a84a882ea3f12b27127d47d289dfc64dda6b6fc956369f5851daaa57ae493
- filename: packages/contentstack-clone/src/lib/util/clone-handler.js
Expand Down Expand Up @@ -109,8 +109,18 @@ fileignoreconfig:
checksum: 34bdde6f85e8b60ebc73e627b315ec3886e5577102fca04c3e20c463c42eb681
- filename: packages/contentstack-audit/src/modules/content-types.ts
checksum: ddf7b08e6a80af09c6a7019a637c26089fb76572c7c3d079a8af244b02985f16
- filename: packages/contentstack-import/test/unit/import/modules/base-class.test.ts
checksum: 850383016629ed840bf12c8bea5b7640230a6e4f6af03d958d2bcbdcc740945d
- filename: packages/contentstack-import/test/unit/commands/cm/stacks/import.test.ts
checksum: 183feddf5ceee765a228c9c3d2759df459722fac20edce3c2fe957a7a28d790a
version: "1.0"
checksum: b11e57f1b824d405f86438e9e7c59183f8c59b66b42d8d16dbeaf76195a30548
- filename: packages/contentstack-import/test/unit/utils/asset-helper.test.ts
checksum: d45ae4939a98a7f50306408d5dc305c8513b54f5d539ddcb0e6bbbd4a97d9675
- filename: packages/contentstack-import/test/unit/import/modules/marketplace-apps.test.ts
checksum: 773bf4b093d6cfb5c6254e3883d773e50cdff97434e04bd2dc9e543105708eb7
- filename: packages/contentstack-import/test/unit/import/modules/mock-data/entries/empty-environments.json
checksum: 1db7db30b8491f79f2881bb862986748c54f75d63d7ee6343517083f7e42a6bf
- filename: packages/contentstack-import/test/unit/import/modules/mock-data/entries/environments.json
checksum: 17f94f500dcb265575b60f8d2cb7464372a234e452527b3bdec6052c606cee28
- filename: packages/contentstack-import/test/unit/import/modules/entries.test.ts
checksum: 7b984d292a534f9d075d801de2aeff802b2832bc5e2efadf8613a7059f4317fc
- filename: packages/contentstack-import/test/unit/import/modules/marketplace-apps.test.ts
checksum: 0d4db99c346e35f49c9da647b4e60c2e3c0203471772e1897affb71cb28f53d8
version: "1.0"
2,636 changes: 1,414 additions & 1,222 deletions package-lock.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/contentstack-audit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
],
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.3",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@oclif/plugin-plugins": "^5.4.38",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-auth/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"otplib": "^12.0.1"
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-bootstrap/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@contentstack/cli-cm-bootstrap",
"description": "Bootstrap contentstack apps",
"version": "1.16.0",
"version": "1.16.1",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"scripts": {
Expand All @@ -18,7 +18,7 @@
"dependencies": {
"@contentstack/cli-cm-seed": "~1.12.2",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"inquirer": "8.2.6",
Expand Down
9 changes: 7 additions & 2 deletions packages/contentstack-bootstrap/src/bootstrap/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -190,12 +190,17 @@ const envFileHandler = async (
if (regionName !== 'eu' && !isUSRegion) {
customHost = region?.cma?.substring(8);
}
let graphqlHost = "graphql.contentstack.com";
if(regionName != 'na'){
graphqlHost = `${regionName}-.graphql.contentstack.com`;
}


// Construct image hostname based on the actual host being used
let imageHostname = '*-images.contentstack.com'; // default fallback
if (region?.cda) {
const baseHost = region.cda.replace(/^https?:\/\//, '').replace(/^[^.]+\./, '');
imageHostname = `*-images.${baseHost}`;
imageHostname = `images.${baseHost}`;
}
const production = environmentVariables.environment === 'production' ? true : false;
switch (appConfigKey) {
Expand All @@ -212,7 +217,7 @@ const envFileHandler = async (
}\nNEXT_PUBLIC_CONTENTSTACK_ENVIRONMENT=${environmentVariables.environment
}\nNEXT_PUBLIC_CONTENTSTACK_REGION=${regionName
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW=${livePreviewEnabled ? 'true' : 'false'
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${cdnHost
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_DELIVERY = ${graphqlHost
}\nNEXT_PUBLIC_CONTENTSTACK_CONTENT_APPLICATION = ${appHost
}\nNEXT_PUBLIC_CONTENTSTACK_PREVIEW_HOST = ${previewHost
}\nNEXT_PUBLIC_CONTENTSTACK_IMAGE_HOSTNAME=${imageHostname}`;
Expand Down
12 changes: 6 additions & 6 deletions packages/contentstack-bootstrap/src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ const config: Configuration = {
{ displayName: 'Kickstart Next.js SSG', configKey: 'kickstart-next-ssg' },
{ displayName: 'Kickstart Next.js GraphQL', configKey: 'kickstart-next-graphql' },
{ displayName: 'Kickstart Next.js Middleware', configKey: 'kickstart-next-middleware' },
{ displayName: 'Kickstart NuxtJS', configKey: 'kickstart-next-nuxt' },
{ displayName: 'Kickstart NuxtJS SSR', configKey: 'kickstart-next-nuxt-ssr' },
{ displayName: 'Kickstart NuxtJS', configKey: 'kickstart-nuxt' },
{ displayName: 'Kickstart NuxtJS SSR', configKey: 'kickstart-nuxt-ssr' },

{ displayName: 'React JS (Deprecated)', configKey: 'reactjs-starter' },
{ displayName: 'Next JS (Deprecated)', configKey: 'nextjs-starter' },
Expand Down Expand Up @@ -66,12 +66,12 @@ const config: Configuration = {
stack: 'contentstack/kickstart-stack-seed',
},

'kickstart-next-nuxt': {
source: 'contentstack/kickstart-next-nuxt',
'kickstart-nuxt': {
source: 'contentstack/kickstart-nuxt',
stack: 'contentstack/kickstart-stack-seed',
},
'kickstart-next-nuxt-ssr': {
source: 'contentstack/kickstart-next-nuxt-ssr',
'kickstart-nuxt-ssr': {
source: 'contentstack/kickstart-nuxt-ssr',
stack: 'contentstack/kickstart-stack-seed',
},
nextjs: {
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-branches/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@contentstack/cli-command": "~1.6.1",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"chalk": "^4.1.2",
"just-diff": "^6.0.2",
"lodash": "^4.17.21"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-bulk-publish/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-config": "~1.15.0",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
4 changes: 2 additions & 2 deletions packages/contentstack-clone/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
"dependencies": {
"@colors/colors": "^1.6.0",
"@contentstack/cli-cm-export": "~1.20.1",
"@contentstack/cli-cm-import": "~1.28.2",
"@contentstack/cli-cm-import": "~1.28.3",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"chalk": "^4.1.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-command/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
"test:unit": "mocha --timeout 10000 --forbid-only \"test/unit/**/*.test.ts\""
},
"dependencies": {
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"contentstack": "^3.25.3",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-config/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
},
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.28",
"lodash": "^4.17.21"
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export-to-csv/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"@oclif/plugin-help": "^6.2.32",
"fast-csv": "^4.3.6",
Expand Down
2 changes: 1 addition & 1 deletion packages/contentstack-export/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-variants": "~1.3.3",
"@oclif/core": "^4.3.3",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"async": "^3.2.6",
"big-json": "^3.2.0",
"bluebird": "^3.7.2",
Expand Down
6 changes: 3 additions & 3 deletions packages/contentstack-import-setup/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@oclif/core": "^4.3.0",
"big-json": "^3.2.0",
"chalk": "^4.1.2",
Expand All @@ -24,7 +24,7 @@
"@types/mkdirp": "^1.0.2",
"@types/mocha": "^8.2.3",
"@types/node": "^14.18.63",
"@types/proxyquire": "^1.3.31",
"@types/rewire": "^2.5.30",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand All @@ -34,7 +34,7 @@
"mocha": "^10.8.2",
"nyc": "^15.1.0",
"oclif": "^4.17.46",
"proxyquire": "^2.1.3",
"rewire": "^9.0.1",
"ts-node": "^10.9.2",
"tsx": "^4.20.3",
"typescript": "^4.9.5"
Expand Down
6 changes: 4 additions & 2 deletions packages/contentstack-import/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@contentstack/cli-cm-import",
"description": "Contentstack CLI plugin to import content into stack",
"version": "1.28.2",
"version": "1.28.3",
"author": "Contentstack",
"bugs": "https://github.com/contentstack/cli/issues",
"dependencies": {
"@contentstack/cli-audit": "~1.15.0",
"@contentstack/cli-command": "~1.6.1",
"@contentstack/cli-utilities": "~1.14.1",
"@contentstack/cli-utilities": "~1.14.4",
"@contentstack/management": "~1.22.0",
"@contentstack/cli-variants": "~1.3.3",
"@oclif/core": "^4.3.0",
Expand All @@ -32,6 +32,7 @@
"@types/mkdirp": "^1.0.2",
"@types/mocha": "^8.2.3",
"@types/node": "^14.18.63",
"@types/rewire": "^2.5.30",
"@types/tar": "^6.1.13",
"@types/uuid": "^9.0.8",
"@typescript-eslint/eslint-plugin": "^5.62.0",
Expand All @@ -40,6 +41,7 @@
"mocha": "^10.8.2",
"nyc": "^15.1.0",
"oclif": "^4.17.46",
"rewire": "^9.0.1",
"ts-node": "^10.9.2",
"typescript": "^4.9.5"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default class ImportWorkflows extends BaseClass {
log.info(`Workflow '${name}' already exists`, this.importConfig.context);
} else {
this.failedWebhooks.push(apiData);
if (error.errors['workflow_stages.0.users']) {
if (error.errors?.['workflow_stages.0.users']) {
log.error(
"Failed to import Workflows as you've specified certain roles in the Stage transition and access rules section. We currently don't import roles to the stack.",
this.importConfig.context,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ describe('ImportCommand', () => {
};

mockFlags = {
'stack-api-key': 'test-api-key',
'stack-api-key': 'test',
'data-dir': '/test/data',
'alias': 'test-alias',
'module': 'entries',
Expand All @@ -43,7 +43,8 @@ describe('ImportCommand', () => {
};

mockImportConfig = {
apiKey: 'test-api-key',
// @ts-ignore-next-line secret-detection
apiKey: 'test',
contentDir: '/test/data',
data: '/test/data',
contentVersion: 1,
Expand All @@ -56,7 +57,8 @@ describe('ImportCommand', () => {
userId: 'user-123',
email: 'test@example.com',
sessionId: 'test-session-123',
apiKey: 'test-api-key',
// @ts-ignore-next-line secret-detection
apiKey: 'test',
orgId: 'org-123',
authenticationMethod: 'Basic Auth',
},
Expand Down Expand Up @@ -210,20 +212,20 @@ describe('ImportCommand', () => {
});

it('should create context with all required properties', () => {
const context = command['createImportContext']('test-api-key', 'Basic Auth');
const context = command['createImportContext']('test', 'Basic Auth');

expect(context).to.have.property('command', 'cm:stacks:import');
expect(context).to.have.property('module', '');
expect(context).to.have.property('userId', 'user-123');
expect(context).to.have.property('email', 'test@example.com');
expect(context).to.have.property('sessionId', 'test-session-123');
expect(context).to.have.property('apiKey', 'test-api-key');
expect(context).to.have.property('apiKey', 'test');
expect(context).to.have.property('orgId', 'org-123');
expect(context).to.have.property('authenticationMethod', 'Basic Auth');
});

it('should use default authentication method when not provided', () => {
const context = command['createImportContext']('test-api-key');
const context = command['createImportContext']('test');

expect(context.authenticationMethod).to.equal('Basic Auth');
});
Expand All @@ -232,7 +234,7 @@ describe('ImportCommand', () => {
configHandlerStub.reset();
configHandlerStub.returns(undefined);

const context = command['createImportContext']('test-api-key', 'Management Token');
const context = command['createImportContext']('test', 'Management Token');

expect(context.userId).to.equal('');
expect(context.email).to.equal('');
Expand All @@ -241,7 +243,7 @@ describe('ImportCommand', () => {
});

it('should use context command when available', () => {
const context = command['createImportContext']('test-api-key');
const context = command['createImportContext']('test');

expect(context.command).to.equal('cm:stacks:import');
});
Expand Down Expand Up @@ -270,7 +272,7 @@ describe('ImportCommand', () => {

// Mock the interactive functions
sinon.stub(interactiveModule, 'askContentDir').resolves('/test/content');
sinon.stub(interactiveModule, 'askAPIKey').resolves('test-api-key');
sinon.stub(interactiveModule, 'askAPIKey').resolves('test');

// Mock log methods by replacing them on the log object
logSuccessStub = sinon.stub().callsFake(() => {});
Expand Down Expand Up @@ -374,7 +376,7 @@ describe('ImportCommand', () => {
ModuleImporterStub = sinon.stub().returns(mockModuleImporter);

sinon.stub(interactiveModule, 'askContentDir').resolves('/test/content');
sinon.stub(interactiveModule, 'askAPIKey').resolves('test-api-key');
sinon.stub(interactiveModule, 'askAPIKey').resolves('test');

logSuccessStub = sinon.stub().callsFake(() => {});
logInfoStub = sinon.stub().callsFake(() => {});
Expand Down Expand Up @@ -504,23 +506,23 @@ describe('ImportCommand', () => {
it('should handle undefined context', () => {
(command as any).context = undefined;

const context = command['createImportContext']('test-api-key');
const context = command['createImportContext']('test');

expect(context.command).to.equal('cm:stacks:import');
});

it('should handle context without info', () => {
(command as any).context = { sessionId: 'test-session' };

const context = command['createImportContext']('test-api-key');
const context = command['createImportContext']('test');

expect(context.command).to.equal('cm:stacks:import');
});

it('should handle context without sessionId', () => {
(command as any).context = { info: { command: 'test' } };

const context = command['createImportContext']('test-api-key');
const context = command['createImportContext']('test');

expect(context.sessionId).to.be.undefined;
});
Expand All @@ -529,7 +531,7 @@ describe('ImportCommand', () => {
configHandlerStub.reset();
configHandlerStub.returns(undefined);

const context = command['createImportContext']('test-api-key');
const context = command['createImportContext']('test');

expect(context.userId).to.equal('');
expect(context.email).to.equal('');
Expand Down
Loading
Loading