коммит произвёл
GitHub
родитель
b45ff0be5d
Коммит
717a4d04a9
@@ -277,7 +277,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
|
||||
},
|
||||
Integration: &PostActionIntegration{
|
||||
URL: "http://localhost",
|
||||
Context: map[string]interface{}{
|
||||
Context: map[string]any{
|
||||
"context": "foobar",
|
||||
"test": 123,
|
||||
},
|
||||
@@ -299,7 +299,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
|
||||
},
|
||||
Integration: &PostActionIntegration{
|
||||
URL: "http://localhost",
|
||||
Context: map[string]interface{}{
|
||||
Context: map[string]any{
|
||||
"context": "foobar",
|
||||
"test": 123,
|
||||
},
|
||||
@@ -324,7 +324,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
|
||||
},
|
||||
Integration: &PostActionIntegration{
|
||||
URL: "http://localhost",
|
||||
Context: map[string]interface{}{
|
||||
Context: map[string]any{
|
||||
"context": "foobar",
|
||||
"test": "mattermost",
|
||||
},
|
||||
@@ -346,7 +346,7 @@ func TestPost_AttachmentsEqual(t *testing.T) {
|
||||
},
|
||||
Integration: &PostActionIntegration{
|
||||
URL: "http://localhost",
|
||||
Context: map[string]interface{}{
|
||||
Context: map[string]any{
|
||||
"context": "foobar",
|
||||
"test": 123,
|
||||
},
|
||||
@@ -848,7 +848,7 @@ func TestPostPatchDisableMentionHighlights(t *testing.T) {
|
||||
|
||||
func TestPostAttachments(t *testing.T) {
|
||||
p := &Post{
|
||||
Props: map[string]interface{}{
|
||||
Props: map[string]any{
|
||||
"attachments": []byte(`[{
|
||||
"actions" : {null}
|
||||
}]
|
||||
@@ -857,17 +857,17 @@ func TestPostAttachments(t *testing.T) {
|
||||
}
|
||||
|
||||
t.Run("empty actions", func(t *testing.T) {
|
||||
p.Props["attachments"] = []interface{}{
|
||||
map[string]interface{}{"actions": []interface{}{}},
|
||||
p.Props["attachments"] = []any{
|
||||
map[string]any{"actions": []any{}},
|
||||
}
|
||||
attachments := p.Attachments()
|
||||
require.Empty(t, attachments[0].Actions)
|
||||
})
|
||||
|
||||
t.Run("a couple of actions", func(t *testing.T) {
|
||||
p.Props["attachments"] = []interface{}{
|
||||
map[string]interface{}{"actions": []interface{}{
|
||||
map[string]interface{}{"id": "test1"}, map[string]interface{}{"id": "test2"}},
|
||||
p.Props["attachments"] = []any{
|
||||
map[string]any{"actions": []any{
|
||||
map[string]any{"id": "test1"}, map[string]any{"id": "test2"}},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -878,9 +878,9 @@ func TestPostAttachments(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("should ignore null actions", func(t *testing.T) {
|
||||
p.Props["attachments"] = []interface{}{
|
||||
map[string]interface{}{"actions": []interface{}{
|
||||
map[string]interface{}{"id": "test1"}, nil, map[string]interface{}{"id": "test2"}, nil, nil},
|
||||
p.Props["attachments"] = []any{
|
||||
map[string]any{"actions": []any{
|
||||
map[string]any{"id": "test1"}, nil, map[string]any{"id": "test2"}, nil, nil},
|
||||
},
|
||||
}
|
||||
|
||||
@@ -891,11 +891,11 @@ func TestPostAttachments(t *testing.T) {
|
||||
})
|
||||
|
||||
t.Run("nil fields", func(t *testing.T) {
|
||||
p.Props["attachments"] = []interface{}{
|
||||
map[string]interface{}{"fields": []interface{}{
|
||||
map[string]interface{}{"value": ":emoji1:"},
|
||||
p.Props["attachments"] = []any{
|
||||
map[string]any{"fields": []any{
|
||||
map[string]any{"value": ":emoji1:"},
|
||||
nil,
|
||||
map[string]interface{}{"value": ":emoji2:"},
|
||||
map[string]any{"value": ":emoji2:"},
|
||||
},
|
||||
},
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user