(t *testing.T)
| 149 | } |
| 150 | |
| 151 | func TestBuildWorkflowDescription(t *testing.T) { |
| 152 | tests := []struct { |
| 153 | name string |
| 154 | inputs map[string]*workflow.InputDefinition |
| 155 | expected string |
| 156 | }{ |
| 157 | { |
| 158 | name: "no inputs", |
| 159 | inputs: nil, |
| 160 | expected: "", |
| 161 | }, |
| 162 | { |
| 163 | name: "only required inputs", |
| 164 | inputs: map[string]*workflow.InputDefinition{ |
| 165 | "input1": {Required: true}, |
| 166 | "input2": {Required: true}, |
| 167 | }, |
| 168 | expected: "", |
| 169 | }, |
| 170 | { |
| 171 | name: "only optional inputs", |
| 172 | inputs: map[string]*workflow.InputDefinition{ |
| 173 | "input1": {Required: false}, |
| 174 | "input2": {Required: false}, |
| 175 | }, |
| 176 | expected: "", |
| 177 | }, |
| 178 | { |
| 179 | name: "mixed inputs", |
| 180 | inputs: map[string]*workflow.InputDefinition{ |
| 181 | "input1": {Required: true}, |
| 182 | "input2": {Required: false}, |
| 183 | "input3": {Required: true}, |
| 184 | }, |
| 185 | expected: "", |
| 186 | }, |
| 187 | } |
| 188 | |
| 189 | for _, tt := range tests { |
| 190 | t.Run(tt.name, func(t *testing.T) { |
| 191 | result := buildWorkflowDescription(tt.inputs) |
| 192 | assert.Equal(t, tt.expected, result) |
| 193 | }) |
| 194 | } |
| 195 | } |
| 196 | |
| 197 | func TestBuildCommandString(t *testing.T) { |
| 198 | tests := []struct { |
nothing calls this directly
no test coverage detected