Merge branch 'haris/migrate-to-v12' into haris/migrate-to-v11
CodeQL checks / Detect whether code changed (push) Waiting to run Details
CodeQL checks / Analyze (actions) (push) Blocked by required conditions Details
CodeQL checks / Analyze (go) (push) Blocked by required conditions Details
CodeQL checks / Analyze (javascript) (push) Blocked by required conditions Details

This commit is contained in:
Haris Rozajac 2025-10-07 16:26:08 -06:00
commit 6361ea0023
1 changed files with 110 additions and 9 deletions

View File

@ -89,6 +89,7 @@ func TestV12(t *testing.T) {
map[string]interface{}{
"type": "query",
"name": "hide_variable_var",
"hideVariable": true,
"hide": 2,
},
},
@ -118,6 +119,7 @@ func TestV12(t *testing.T) {
map[string]interface{}{
"type": "query",
"name": "hide_label_var",
"hideLabel": true,
"hide": 1,
},
},
@ -148,6 +150,8 @@ func TestV12(t *testing.T) {
map[string]interface{}{
"type": "query",
"name": "priority_var",
"hideVariable": true,
"hideLabel": true,
"hide": 2,
},
},
@ -209,6 +213,103 @@ func TestV12(t *testing.T) {
},
},
},
{
name: "variables with hideVariable=false and hideLabel=false do not get hide property",
input: map[string]interface{}{
"title": "V12 False Hide Properties Test",
"schemaVersion": 11,
"templating": map[string]interface{}{
"list": []interface{}{
map[string]interface{}{
"type": "query",
"name": "false_hide_var",
"hideVariable": false,
"hideLabel": false,
},
},
},
},
expected: map[string]interface{}{
"title": "V12 False Hide Properties Test",
"schemaVersion": 12,
"templating": map[string]interface{}{
"list": []interface{}{
map[string]interface{}{
"type": "query",
"name": "false_hide_var",
"hideVariable": false,
"hideLabel": false,
},
},
},
},
},
{
name: "variable with hideVariable=false but hideLabel=true gets hide=1",
input: map[string]interface{}{
"title": "V12 Mixed Hide Properties Test",
"schemaVersion": 11,
"templating": map[string]interface{}{
"list": []interface{}{
map[string]interface{}{
"type": "query",
"name": "mixed_hide_var",
"hideVariable": false,
"hideLabel": true,
},
},
},
},
expected: map[string]interface{}{
"title": "V12 Mixed Hide Properties Test",
"schemaVersion": 12,
"templating": map[string]interface{}{
"list": []interface{}{
map[string]interface{}{
"type": "query",
"name": "mixed_hide_var",
"hideVariable": false,
"hideLabel": true,
"hide": 1,
},
},
},
},
},
{
name: "variable with all properties gets all migrations applied",
input: map[string]interface{}{
"title": "V12 All Properties Test",
"schemaVersion": 11,
"templating": map[string]interface{}{
"list": []interface{}{
map[string]interface{}{
"type": "query",
"name": "all_properties_var",
"refresh": true,
"hideVariable": true,
"hideLabel": false,
},
},
},
},
expected: map[string]interface{}{
"title": "V12 All Properties Test",
"schemaVersion": 12,
"templating": map[string]interface{}{
"list": []interface{}{
map[string]interface{}{
"type": "query",
"name": "all_properties_var",
"refresh": 1,
"hideVariable": true,
"hideLabel": false,
"hide": 2,
},
},
},
},
},
}
runMigrationTests(t, tests, schemaversion.V12)