mirror of
https://github.com/coder/coder.git
synced 2026-09-24 15:04:27 +08:00
fix: use dynamic parameter resolution in the cli (#21734)
Uses dynamic parameters EvaluateTemplateVersion vs TemplateVersionRichParameters to determine initial parameter state. Closes https://github.com/coder/coder/issues/19879
This commit is contained in:
+12
-12
@@ -413,13 +413,13 @@ func TestUpdateValidateRichParameters(t *testing.T) {
|
||||
}()
|
||||
|
||||
pty.ExpectMatch(stringParameterName)
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("$$")
|
||||
pty.ExpectMatch("does not match")
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.WriteLine("")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("ABC")
|
||||
pty.ExpectMatch("does not match")
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("abc")
|
||||
_ = testutil.TryReceive(ctx, t, doneChan)
|
||||
})
|
||||
@@ -459,13 +459,13 @@ func TestUpdateValidateRichParameters(t *testing.T) {
|
||||
}()
|
||||
|
||||
pty.ExpectMatch(numberParameterName)
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("12")
|
||||
pty.ExpectMatch("is more than the maximum")
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.WriteLine("")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("notanumber")
|
||||
pty.ExpectMatch("is not a number")
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("8")
|
||||
_ = testutil.TryReceive(ctx, t, doneChan)
|
||||
})
|
||||
@@ -505,13 +505,13 @@ func TestUpdateValidateRichParameters(t *testing.T) {
|
||||
}()
|
||||
|
||||
pty.ExpectMatch(boolParameterName)
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("cat")
|
||||
pty.ExpectMatch("boolean value can be either \"true\" or \"false\"")
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.WriteLine("")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("dog")
|
||||
pty.ExpectMatch("boolean value can be either \"true\" or \"false\"")
|
||||
pty.ExpectMatch("> Enter a value (default: \"\"): ")
|
||||
pty.ExpectMatch("> Enter a value: ")
|
||||
pty.WriteLine("false")
|
||||
_ = testutil.TryReceive(ctx, t, doneChan)
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user