[MM-62427] Add message attachments validation (#30180)
* Add message attachments validation * Add props validation * Validate slack attachment fields * Update tests and library usage * Improve interactive dialog error for length checks * Allow predefined colors for slack attachments * Fix TestPostAction * Use const for data source * Add tests * Cleanup unused props * Add happy path tests * lint fixes * Add validation for PostActionOptions
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
5609489e86
Коммит
9b5d8d52bf
@@ -36,10 +36,11 @@ func TestClient4TrimTrailingSlash(t *testing.T) {
|
||||
func TestClient4CreatePost(t *testing.T) {
|
||||
post := &model.Post{
|
||||
Props: map[string]any{
|
||||
"attachments": []*model.SlackAttachment{
|
||||
model.PostPropsAttachments: []*model.SlackAttachment{
|
||||
{
|
||||
Actions: []*model.PostAction{
|
||||
{
|
||||
Type: model.PostActionTypeButton,
|
||||
Integration: &model.PostActionIntegration{
|
||||
Context: map[string]any{
|
||||
"foo": "bar",
|
||||
@@ -63,6 +64,7 @@ func TestClient4CreatePost(t *testing.T) {
|
||||
{
|
||||
Actions: []*model.PostAction{
|
||||
{
|
||||
Type: model.PostActionTypeButton,
|
||||
Integration: &model.PostActionIntegration{
|
||||
Context: map[string]any{
|
||||
"foo": "bar",
|
||||
|
||||
Ссылка в новой задаче
Block a user