@@ -28,7 +28,7 @@ describe('ImportCommand', () => {
2828 } ;
2929
3030 mockFlags = {
31- 'stack-api-key' : 'test-api-key ' ,
31+ 'stack-api-key' : 'test' ,
3232 'data-dir' : '/test/data' ,
3333 'alias' : 'test-alias' ,
3434 'module' : 'entries' ,
@@ -43,7 +43,8 @@ describe('ImportCommand', () => {
4343 } ;
4444
4545 mockImportConfig = {
46- apiKey : 'test-api-key' ,
46+ // @ts -ignore-next-line secret-detection
47+ apiKey : 'test' ,
4748 contentDir : '/test/data' ,
4849 data : '/test/data' ,
4950 contentVersion : 1 ,
@@ -56,7 +57,8 @@ describe('ImportCommand', () => {
5657 userId : 'user-123' ,
5758 email : 'test@example.com' ,
5859 sessionId : 'test-session-123' ,
59- apiKey : 'test-api-key' ,
60+ // @ts -ignore-next-line secret-detection
61+ apiKey : 'test' ,
6062 orgId : 'org-123' ,
6163 authenticationMethod : 'Basic Auth' ,
6264 } ,
@@ -210,20 +212,20 @@ describe('ImportCommand', () => {
210212 } ) ;
211213
212214 it ( 'should create context with all required properties' , ( ) => {
213- const context = command [ 'createImportContext' ] ( 'test-api-key ' , 'Basic Auth' ) ;
215+ const context = command [ 'createImportContext' ] ( 'test' , 'Basic Auth' ) ;
214216
215217 expect ( context ) . to . have . property ( 'command' , 'cm:stacks:import' ) ;
216218 expect ( context ) . to . have . property ( 'module' , '' ) ;
217219 expect ( context ) . to . have . property ( 'userId' , 'user-123' ) ;
218220 expect ( context ) . to . have . property ( 'email' , 'test@example.com' ) ;
219221 expect ( context ) . to . have . property ( 'sessionId' , 'test-session-123' ) ;
220- expect ( context ) . to . have . property ( 'apiKey' , 'test-api-key ' ) ;
222+ expect ( context ) . to . have . property ( 'apiKey' , 'test' ) ;
221223 expect ( context ) . to . have . property ( 'orgId' , 'org-123' ) ;
222224 expect ( context ) . to . have . property ( 'authenticationMethod' , 'Basic Auth' ) ;
223225 } ) ;
224226
225227 it ( 'should use default authentication method when not provided' , ( ) => {
226- const context = command [ 'createImportContext' ] ( 'test-api-key ' ) ;
228+ const context = command [ 'createImportContext' ] ( 'test' ) ;
227229
228230 expect ( context . authenticationMethod ) . to . equal ( 'Basic Auth' ) ;
229231 } ) ;
@@ -232,7 +234,7 @@ describe('ImportCommand', () => {
232234 configHandlerStub . reset ( ) ;
233235 configHandlerStub . returns ( undefined ) ;
234236
235- const context = command [ 'createImportContext' ] ( 'test-api-key ' , 'Management Token' ) ;
237+ const context = command [ 'createImportContext' ] ( 'test' , 'Management Token' ) ;
236238
237239 expect ( context . userId ) . to . equal ( '' ) ;
238240 expect ( context . email ) . to . equal ( '' ) ;
@@ -241,7 +243,7 @@ describe('ImportCommand', () => {
241243 } ) ;
242244
243245 it ( 'should use context command when available' , ( ) => {
244- const context = command [ 'createImportContext' ] ( 'test-api-key ' ) ;
246+ const context = command [ 'createImportContext' ] ( 'test' ) ;
245247
246248 expect ( context . command ) . to . equal ( 'cm:stacks:import' ) ;
247249 } ) ;
@@ -270,7 +272,7 @@ describe('ImportCommand', () => {
270272
271273 // Mock the interactive functions
272274 sinon . stub ( interactiveModule , 'askContentDir' ) . resolves ( '/test/content' ) ;
273- sinon . stub ( interactiveModule , 'askAPIKey' ) . resolves ( 'test-api-key ' ) ;
275+ sinon . stub ( interactiveModule , 'askAPIKey' ) . resolves ( 'test' ) ;
274276
275277 // Mock log methods by replacing them on the log object
276278 logSuccessStub = sinon . stub ( ) . callsFake ( ( ) => { } ) ;
@@ -374,7 +376,7 @@ describe('ImportCommand', () => {
374376 ModuleImporterStub = sinon . stub ( ) . returns ( mockModuleImporter ) ;
375377
376378 sinon . stub ( interactiveModule , 'askContentDir' ) . resolves ( '/test/content' ) ;
377- sinon . stub ( interactiveModule , 'askAPIKey' ) . resolves ( 'test-api-key ' ) ;
379+ sinon . stub ( interactiveModule , 'askAPIKey' ) . resolves ( 'test' ) ;
378380
379381 logSuccessStub = sinon . stub ( ) . callsFake ( ( ) => { } ) ;
380382 logInfoStub = sinon . stub ( ) . callsFake ( ( ) => { } ) ;
@@ -504,23 +506,23 @@ describe('ImportCommand', () => {
504506 it ( 'should handle undefined context' , ( ) => {
505507 ( command as any ) . context = undefined ;
506508
507- const context = command [ 'createImportContext' ] ( 'test-api-key ' ) ;
509+ const context = command [ 'createImportContext' ] ( 'test' ) ;
508510
509511 expect ( context . command ) . to . equal ( 'cm:stacks:import' ) ;
510512 } ) ;
511513
512514 it ( 'should handle context without info' , ( ) => {
513515 ( command as any ) . context = { sessionId : 'test-session' } ;
514516
515- const context = command [ 'createImportContext' ] ( 'test-api-key ' ) ;
517+ const context = command [ 'createImportContext' ] ( 'test' ) ;
516518
517519 expect ( context . command ) . to . equal ( 'cm:stacks:import' ) ;
518520 } ) ;
519521
520522 it ( 'should handle context without sessionId' , ( ) => {
521523 ( command as any ) . context = { info : { command : 'test' } } ;
522524
523- const context = command [ 'createImportContext' ] ( 'test-api-key ' ) ;
525+ const context = command [ 'createImportContext' ] ( 'test' ) ;
524526
525527 expect ( context . sessionId ) . to . be . undefined ;
526528 } ) ;
@@ -529,7 +531,7 @@ describe('ImportCommand', () => {
529531 configHandlerStub . reset ( ) ;
530532 configHandlerStub . returns ( undefined ) ;
531533
532- const context = command [ 'createImportContext' ] ( 'test-api-key ' ) ;
534+ const context = command [ 'createImportContext' ] ( 'test' ) ;
533535
534536 expect ( context . userId ) . to . equal ( '' ) ;
535537 expect ( context . email ) . to . equal ( '' ) ;
0 commit comments