Skip to content

Commit

Permalink
chore: updated test
Browse files Browse the repository at this point in the history
  • Loading branch information
jbristowe committed Jul 27, 2022
1 parent 532b4bd commit 1b67622
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions test/resources/display_settings_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,10 @@ func TestDisplaySettingsAsJson(t *testing.T) {
require.NotNil(t, displaySettingsAsJson)

jsonassert.New(t).Assertf(expectedJson, string(displaySettingsAsJson))
}

func TestSelectOptions(t *testing.T) {
controlType := "Select"
option1 := internal.GetRandomName()
value1 := internal.GetRandomName()
option2 := internal.GetRandomName()
Expand All @@ -57,18 +60,13 @@ func TestDisplaySettingsAsJson(t *testing.T) {
option3: value3,
}

displaySettings = variables.NewDisplaySettings(controlType, selectOptions)

expectedJson = fmt.Sprintf(`{
"Octopus.ControlType": "%s",
"Octopus.SelectOptions": "%s|%s\n%s|%s\n%s|%s"
}`, controlType, option1, value1, option2, value2, option3, value3)
displaySettings := variables.NewDisplaySettings(controlType, selectOptions)

displaySettingsAsJson, err = json.Marshal(displaySettings)
displaySettingsAsJson, err := json.Marshal(displaySettings)
require.NoError(t, err)
require.NotNil(t, displaySettingsAsJson)

jsonassert.New(t).Assertf(string(displaySettingsAsJson), expectedJson)
// TODO: loop through each select option; verify count and option/value pairs
}

func TestDisplaySettingsFromJson(t *testing.T) {
Expand Down

0 comments on commit 1b67622

Please sign in to comment.