@@ -418,7 +418,9 @@ func TestUpdateValidateRichParameters(t *testing.T) {
418
418
err := inv .Run ()
419
419
require .NoError (t , err )
420
420
421
+ ctx := testutil .Context (t , testutil .WaitLong )
421
422
inv , root = clitest .New (t , "update" , "my-workspace" , "--always-prompt" )
423
+ inv = inv .WithContext (ctx )
422
424
clitest .SetupConfig (t , member , root )
423
425
doneChan := make (chan struct {})
424
426
pty := ptytest .New (t ).Attach (inv )
@@ -428,18 +430,16 @@ func TestUpdateValidateRichParameters(t *testing.T) {
428
430
assert .NoError (t , err )
429
431
}()
430
432
431
- matches := []string {
432
- boolParameterName , "cat" ,
433
- "boolean value can be either" , "" ,
434
- "Enter a value" , "false" ,
435
- }
436
- for i := 0 ; i < len (matches ); i += 2 {
437
- match := matches [i ]
438
- value := matches [i + 1 ]
439
- pty .ExpectMatch (match )
440
- pty .WriteLine (value )
441
- }
442
- <- doneChan
433
+ pty .ExpectMatch (boolParameterName )
434
+ pty .ExpectMatch ("> Enter a value (default: \" \" ): " )
435
+ pty .WriteLine ("cat" )
436
+ pty .ExpectMatch ("boolean value can be either \" true\" or \" false\" " )
437
+ pty .ExpectMatch ("> Enter a value (default: \" \" ): " )
438
+ pty .WriteLine ("" )
439
+ pty .ExpectMatch ("boolean value can be either \" true\" or \" false\" " )
440
+ pty .ExpectMatch ("> Enter a value (default: \" \" ): " )
441
+ pty .WriteLine ("false" )
442
+ _ = testutil .RequireRecvCtx (ctx , t , doneChan )
443
443
})
444
444
445
445
t .Run ("RequiredParameterAdded" , func (t * testing.T ) {
0 commit comments