@@ -434,6 +434,86 @@ describe('Pipeline Build validation schema', () => {
434434 . catch ( shouldHavePassed ) ;
435435 } ) ;
436436
437+ it ( 'should pass if the task params is string and empty' , async ( ) => {
438+ await withFormData ( {
439+ ...initialPipelineFormData ,
440+ tasks : [
441+ {
442+ name : 'test-task' ,
443+ taskSpec : embeddedTaskSpec ,
444+ params : [ { name : 'test_param' , value : '' } ] ,
445+ } ,
446+ ] ,
447+ } )
448+ . then ( hasResults )
449+ . catch ( shouldHavePassed ) ;
450+ } ) ;
451+
452+ it ( 'should pass if the task params is array and empty' , async ( ) => {
453+ await withFormData ( {
454+ ...initialPipelineFormData ,
455+ tasks : [
456+ {
457+ name : 'test-task' ,
458+ taskSpec : embeddedTaskSpec ,
459+ params : [ { name : 'test_param' , value : [ ] } ] ,
460+ } ,
461+ ] ,
462+ } )
463+ . then ( hasResults )
464+ . catch ( shouldHavePassed ) ;
465+ } ) ;
466+
467+ it ( 'should pass if the task params is array and has empty string as value' , async ( ) => {
468+ await withFormData ( {
469+ ...initialPipelineFormData ,
470+ tasks : [
471+ {
472+ name : 'test-task' ,
473+ taskSpec : embeddedTaskSpec ,
474+ params : [ { name : 'test_param' , value : [ '' ] } ] ,
475+ } ,
476+ ] ,
477+ } )
478+ . then ( hasResults )
479+ . catch ( shouldHavePassed ) ;
480+ } ) ;
481+
482+ it ( 'should pass if the task params is string and has a value' , async ( ) => {
483+ await withFormData ( {
484+ ...initialPipelineFormData ,
485+ tasks : [
486+ {
487+ name : 'test-task' ,
488+ taskSpec : embeddedTaskSpec ,
489+ params : [ { name : 'test_param' , value : 'some value' } ] ,
490+ } ,
491+ ] ,
492+ } )
493+ . then ( hasResults )
494+ . catch ( shouldHavePassed ) ;
495+ } ) ;
496+
497+ it ( 'should pass if the task params is array and has values' , async ( ) => {
498+ await withFormData ( {
499+ ...initialPipelineFormData ,
500+ tasks : [
501+ {
502+ name : 'test-task' ,
503+ taskSpec : embeddedTaskSpec ,
504+ params : [
505+ {
506+ name : 'test_param' ,
507+ value : [ 'some value arg1' , 'some value arg2' ] ,
508+ } ,
509+ ] ,
510+ } ,
511+ ] ,
512+ } )
513+ . then ( hasResults )
514+ . catch ( shouldHavePassed ) ;
515+ } ) ;
516+
437517 it ( 'should fail if the taskSpec params are required and not provided' , async ( ) => {
438518 const taskSpecWithParam = merge ( { } , embeddedTaskSpec , {
439519 params : [ { name : 'name' , description : 'Your name to echo out' } ] ,
0 commit comments