MM-15219 Add support for introduction text in interactive dial… (#12029)

Этот коммит содержится в:
Theo Gkourasas
2019-09-11 11:31:51 -04:00
коммит произвёл Ben Schumacher
родитель a5f04802e8
Коммит 98489b9e67
2 изменённых файлов: 21 добавлений и 8 удалений

Просмотреть файл

@@ -142,8 +142,20 @@ func TestOpenDialog(t *testing.T) {
CheckBadRequestStatus(t, resp)
assert.False(t, pass)
// Should pass with no elements
// Should pass with markdown formatted introduction text
request.URL = "http://localhost:8065"
request.Dialog.IntroductionText = "**Some** _introduction text"
pass, resp = Client.OpenInteractiveDialog(request)
CheckNoError(t, resp)
assert.True(t, pass)
// Should pass with empty introduction text
request.Dialog.IntroductionText = ""
pass, resp = Client.OpenInteractiveDialog(request)
CheckNoError(t, resp)
assert.True(t, pass)
// Should pass with no elements
request.Dialog.Elements = nil
pass, resp = Client.OpenInteractiveDialog(request)
CheckNoError(t, resp)

Просмотреть файл

@@ -178,13 +178,14 @@ type PostActionAPIResponse struct {
}
type Dialog struct {
CallbackId string `json:"callback_id"`
Title string `json:"title"`
IconURL string `json:"icon_url"`
Elements []DialogElement `json:"elements"`
SubmitLabel string `json:"submit_label"`
NotifyOnCancel bool `json:"notify_on_cancel"`
State string `json:"state"`
CallbackId string `json:"callback_id"`
Title string `json:"title"`
IntroductionText string `json:"introduction_text"`
IconURL string `json:"icon_url"`
Elements []DialogElement `json:"elements"`
SubmitLabel string `json:"submit_label"`
NotifyOnCancel bool `json:"notify_on_cancel"`
State string `json:"state"`
}
type DialogElement struct {