mirror of
https://github.com/coder/coder.git
synced 2025-07-03 16:13:58 +00:00
feat: archive template versions to hide them from the ui (#10179)
* api + cli implementation
This commit is contained in:
@ -157,6 +157,48 @@ func TestParseQueryParams(t *testing.T) {
|
||||
testQueryParams(t, expParams, parser, parser.String)
|
||||
})
|
||||
|
||||
t.Run("Boolean", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
expParams := []queryParamTestCase[bool]{
|
||||
{
|
||||
QueryParam: "valid_true",
|
||||
Value: "true",
|
||||
Expected: true,
|
||||
},
|
||||
{
|
||||
QueryParam: "casing",
|
||||
Value: "True",
|
||||
Expected: true,
|
||||
},
|
||||
{
|
||||
QueryParam: "all_caps",
|
||||
Value: "TRUE",
|
||||
Expected: true,
|
||||
},
|
||||
{
|
||||
QueryParam: "no_value_true_def",
|
||||
NoSet: true,
|
||||
Default: true,
|
||||
Expected: true,
|
||||
},
|
||||
{
|
||||
QueryParam: "no_value",
|
||||
NoSet: true,
|
||||
Expected: false,
|
||||
},
|
||||
|
||||
{
|
||||
QueryParam: "invalid_boolean",
|
||||
Value: "yes",
|
||||
Expected: false,
|
||||
ExpectedErrorContains: "must be a valid boolean",
|
||||
},
|
||||
}
|
||||
|
||||
parser := httpapi.NewQueryParamParser()
|
||||
testQueryParams(t, expParams, parser, parser.Boolean)
|
||||
})
|
||||
|
||||
t.Run("Int", func(t *testing.T) {
|
||||
t.Parallel()
|
||||
expParams := []queryParamTestCase[int]{
|
||||
|
Reference in New Issue
Block a user