summaryrefslogtreecommitdiffstats
path: root/model/manifest_test.go
diff options
context:
space:
mode:
authorChris <ccbrown112@gmail.com>2017-11-30 10:57:47 -0600
committerGitHub <noreply@github.com>2017-11-30 10:57:47 -0600
commiteaca461ee35993c07936a5888c003153d9e9b24f (patch)
tree28072100fd71784a58dd8fcc839113f8380a4029 /model/manifest_test.go
parentc30a3aff9f8f2288fdaa1359e38aca86f9524978 (diff)
downloadchat-eaca461ee35993c07936a5888c003153d9e9b24f.tar.gz
chat-eaca461ee35993c07936a5888c003153d9e9b24f.tar.bz2
chat-eaca461ee35993c07936a5888c003153d9e9b24f.zip
ordered plugin settings (#7919)
Diffstat (limited to 'model/manifest_test.go')
-rw-r--r--model/manifest_test.go68
1 files changed, 36 insertions, 32 deletions
diff --git a/model/manifest_test.go b/model/manifest_test.go
index 0edd1fed4..3fdc13ec4 100644
--- a/model/manifest_test.go
+++ b/model/manifest_test.go
@@ -70,8 +70,9 @@ func TestManifestUnmarshal(t *testing.T) {
SettingsSchema: &PluginSettingsSchema{
Header: "theheadertext",
Footer: "thefootertext",
- Settings: map[string]*PluginSetting{
- "thesetting": &PluginSetting{
+ Settings: []*PluginSetting{
+ &PluginSetting{
+ Key: "thesetting",
DisplayName: "thedisplayname",
Type: PLUGIN_CONFIG_TYPE_DROPDOWN,
HelpText: "thehelptext",
@@ -100,16 +101,16 @@ settings_schema:
header: theheadertext
footer: thefootertext
settings:
- thesetting:
- display_name: thedisplayname
- type: dropdown
- help_text: thehelptext
- regenerate_help_text: theregeneratehelptext
- placeholder: theplaceholder
- options:
- - display_name: theoptiondisplayname
- value: thevalue
- default: thedefault
+ - key: thesetting
+ display_name: thedisplayname
+ type: dropdown
+ help_text: thehelptext
+ regenerate_help_text: theregeneratehelptext
+ placeholder: theplaceholder
+ options:
+ - display_name: theoptiondisplayname
+ value: thevalue
+ default: thedefault
`), &yamlResult))
assert.Equal(t, expected, yamlResult)
@@ -125,22 +126,23 @@ settings_schema:
"settings_schema": {
"header": "theheadertext",
"footer": "thefootertext",
- "settings": {
- "thesetting": {
- "display_name": "thedisplayname",
- "type": "dropdown",
- "help_text": "thehelptext",
- "regenerate_help_text": "theregeneratehelptext",
- "placeholder": "theplaceholder",
- "options": [
- {
- "display_name": "theoptiondisplayname",
- "value": "thevalue"
- }
- ],
- "default": "thedefault"
- }
- }
+ "settings": [
+ {
+ "key": "thesetting",
+ "display_name": "thedisplayname",
+ "type": "dropdown",
+ "help_text": "thehelptext",
+ "regenerate_help_text": "theregeneratehelptext",
+ "placeholder": "theplaceholder",
+ "options": [
+ {
+ "display_name": "theoptiondisplayname",
+ "value": "thevalue"
+ }
+ ],
+ "default": "thedefault"
+ }
+ ]
}
}`), &jsonResult))
assert.Equal(t, expected, jsonResult)
@@ -175,8 +177,9 @@ func TestManifestJson(t *testing.T) {
SettingsSchema: &PluginSettingsSchema{
Header: "theheadertext",
Footer: "thefootertext",
- Settings: map[string]*PluginSetting{
- "thesetting": &PluginSetting{
+ Settings: []*PluginSetting{
+ &PluginSetting{
+ Key: "thesetting",
DisplayName: "thedisplayname",
Type: PLUGIN_CONFIG_TYPE_DROPDOWN,
HelpText: "thehelptext",
@@ -239,8 +242,9 @@ func TestManifestClientManifest(t *testing.T) {
SettingsSchema: &PluginSettingsSchema{
Header: "theheadertext",
Footer: "thefootertext",
- Settings: map[string]*PluginSetting{
- "thesetting": &PluginSetting{
+ Settings: []*PluginSetting{
+ &PluginSetting{
+ Key: "thesetting",
DisplayName: "thedisplayname",
Type: PLUGIN_CONFIG_TYPE_DROPDOWN,
HelpText: "thehelptext",