@@ -71,22 +71,36 @@ function createComponent(opts: {
7171
7272describe ( 'resolveSecretInputOverrides' , ( ) => {
7373 it ( 'resolves a secret-type input override via secrets.get()' , async ( ) => {
74+ const previousDebugValue = process . env . SENTRIS_DEBUG_WORKFLOW ;
75+ const consoleSpy = vi . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } ) ;
7476 const secrets = createMockSecrets ( { 'secret-id-1' : 'my-api-key' } ) ;
7577 const component = createComponent ( {
7678 inputPorts : [ { id : 'apiKey' , editor : 'secret' } ] ,
7779 } ) ;
7880
79- const inputs : Record < string , unknown > = { } ;
80- const overrides = { apiKey : 'secret-id-1' } ;
81+ try {
82+ delete process . env . SENTRIS_DEBUG_WORKFLOW ;
8183
82- await resolveSecretInputOverrides ( inputs , overrides , {
83- secrets,
84- component,
85- resolvedParams : { } ,
86- } ) ;
84+ const inputs : Record < string , unknown > = { } ;
85+ const overrides = { apiKey : 'secret-id-1' } ;
8786
88- expect ( inputs . apiKey ) . toBe ( 'my-api-key' ) ;
89- expect ( secrets . get ) . toHaveBeenCalledWith ( 'secret-id-1' ) ;
87+ await resolveSecretInputOverrides ( inputs , overrides , {
88+ secrets,
89+ component,
90+ resolvedParams : { } ,
91+ } ) ;
92+
93+ expect ( inputs . apiKey ) . toBe ( 'my-api-key' ) ;
94+ expect ( secrets . get ) . toHaveBeenCalledWith ( 'secret-id-1' ) ;
95+ expect ( consoleSpy ) . not . toHaveBeenCalled ( ) ;
96+ } finally {
97+ consoleSpy . mockRestore ( ) ;
98+ if ( previousDebugValue === undefined ) {
99+ delete process . env . SENTRIS_DEBUG_WORKFLOW ;
100+ } else {
101+ process . env . SENTRIS_DEBUG_WORKFLOW = previousDebugValue ;
102+ }
103+ }
90104 } ) ;
91105
92106 it ( 'leaves non-secret input overrides untouched' , async ( ) => {
@@ -267,23 +281,37 @@ describe('resolveSecretInputOverrides', () => {
267281
268282describe ( 'resolveSecretParams' , ( ) => {
269283 it ( 'resolves secret-type parameter and writes to params' , async ( ) => {
284+ const previousDebugValue = process . env . SENTRIS_DEBUG_WORKFLOW ;
285+ const consoleSpy = vi . spyOn ( console , 'log' ) . mockImplementation ( ( ) => { } ) ;
270286 const secrets = createMockSecrets ( { 'param-secret' : 'secret-val' } ) ;
271287 const component = createComponent ( {
272288 paramPorts : [ { id : 'password' , editor : 'secret' } ] ,
273289 } ) ;
274290
275- const params : Record < string , unknown > = { } ;
291+ try {
292+ delete process . env . SENTRIS_DEBUG_WORKFLOW ;
276293
277- await resolveSecretParams (
278- params ,
279- { password : 'param-secret' } ,
280- {
281- secrets,
282- component,
283- } ,
284- ) ;
294+ const params : Record < string , unknown > = { } ;
285295
286- expect ( params . password ) . toBe ( 'secret-val' ) ;
296+ await resolveSecretParams (
297+ params ,
298+ { password : 'param-secret' } ,
299+ {
300+ secrets,
301+ component,
302+ } ,
303+ ) ;
304+
305+ expect ( params . password ) . toBe ( 'secret-val' ) ;
306+ expect ( consoleSpy ) . not . toHaveBeenCalled ( ) ;
307+ } finally {
308+ consoleSpy . mockRestore ( ) ;
309+ if ( previousDebugValue === undefined ) {
310+ delete process . env . SENTRIS_DEBUG_WORKFLOW ;
311+ } else {
312+ process . env . SENTRIS_DEBUG_WORKFLOW = previousDebugValue ;
313+ }
314+ }
287315 } ) ;
288316
289317 it ( 'leaves non-secret parameters untouched' , async ( ) => {
0 commit comments