MCPcopy Index your code
hub / github.com/coder/coder / TestTemplateVersionParameters_Order

Function TestTemplateVersionParameters_Order

coderd/templateversions_test.go:2378–2462  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

2376}
2377
2378func TestTemplateVersionParameters_Order(t *testing.T) {
2379 t.Parallel()
2380
2381 const (
2382 firstParameterName = "first_parameter"
2383 firstParameterType = "string"
2384 firstParameterValue = "aaa"
2385 // no order
2386
2387 secondParameterName = "Second_parameter"
2388 secondParameterType = "number"
2389 secondParameterValue = "2"
2390 secondParameterOrder = 3
2391
2392 thirdParameterName = "third_parameter"
2393 thirdParameterType = "number"
2394 thirdParameterValue = "3"
2395 thirdParameterOrder = 3
2396
2397 fourthParameterName = "Fourth_parameter"
2398 fourthParameterType = "number"
2399 fourthParameterValue = "3"
2400 fourthParameterOrder = 2
2401
2402 fifthParameterName = "Fifth_parameter"
2403 fifthParameterType = "string"
2404 fifthParameterValue = "aaa"
2405 // no order
2406 )
2407
2408 client := coderdtest.New(t, &coderdtest.Options{IncludeProvisionerDaemon: true})
2409 user := coderdtest.CreateFirstUser(t, client)
2410 version := coderdtest.CreateTemplateVersion(t, client, user.OrganizationID, &echo.Responses{
2411 Parse: echo.ParseComplete,
2412 ProvisionGraph: []*proto.Response{
2413 {
2414 Type: &proto.Response_Graph{
2415 Graph: &proto.GraphComplete{
2416 Parameters: []*proto.RichParameter{
2417 {
2418 Name: firstParameterName,
2419 Type: firstParameterType,
2420 // No order
2421 },
2422 {
2423 Name: secondParameterName,
2424 Type: secondParameterType,
2425 Order: secondParameterOrder,
2426 },
2427 {
2428 Name: thirdParameterName,
2429 Type: thirdParameterType,
2430 Order: thirdParameterOrder,
2431 },
2432 {
2433 Name: fourthParameterName,
2434 Type: fourthParameterType,
2435 Order: fourthParameterOrder,

Callers

nothing calls this directly

Calls 7

NewFunction · 0.92
CreateFirstUserFunction · 0.92
CreateTemplateVersionFunction · 0.92
LenMethod · 0.45
EqualMethod · 0.45

Tested by

no test coverage detected