MM-15219 Add support for introduction text in interactive dial… (#12029)
Этот коммит содержится в:
коммит произвёл
Ben Schumacher
родитель
a5f04802e8
Коммит
98489b9e67
@@ -142,8 +142,20 @@ func TestOpenDialog(t *testing.T) {
|
|||||||
CheckBadRequestStatus(t, resp)
|
CheckBadRequestStatus(t, resp)
|
||||||
assert.False(t, pass)
|
assert.False(t, pass)
|
||||||
|
|
||||||
// Should pass with no elements
|
// Should pass with markdown formatted introduction text
|
||||||
request.URL = "http://localhost:8065"
|
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
|
request.Dialog.Elements = nil
|
||||||
pass, resp = Client.OpenInteractiveDialog(request)
|
pass, resp = Client.OpenInteractiveDialog(request)
|
||||||
CheckNoError(t, resp)
|
CheckNoError(t, resp)
|
||||||
|
|||||||
@@ -178,13 +178,14 @@ type PostActionAPIResponse struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
type Dialog struct {
|
type Dialog struct {
|
||||||
CallbackId string `json:"callback_id"`
|
CallbackId string `json:"callback_id"`
|
||||||
Title string `json:"title"`
|
Title string `json:"title"`
|
||||||
IconURL string `json:"icon_url"`
|
IntroductionText string `json:"introduction_text"`
|
||||||
Elements []DialogElement `json:"elements"`
|
IconURL string `json:"icon_url"`
|
||||||
SubmitLabel string `json:"submit_label"`
|
Elements []DialogElement `json:"elements"`
|
||||||
NotifyOnCancel bool `json:"notify_on_cancel"`
|
SubmitLabel string `json:"submit_label"`
|
||||||
State string `json:"state"`
|
NotifyOnCancel bool `json:"notify_on_cancel"`
|
||||||
|
State string `json:"state"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type DialogElement struct {
|
type DialogElement struct {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user