| 1 | package slack |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | ) |
| 8 | |
| 9 | func TestNewActionBlock(t *testing.T) { |
| 10 | |
| 11 | approveBtnTxt := NewTextBlockObject("plain_text", "Approve", false, false) |
| 12 | approveBtn := NewButtonBlockElement("", "click_me_123", approveBtnTxt) |
| 13 | |
| 14 | actionBlock := NewActionBlock("test", approveBtn) |
| 15 | assert.Equal(t, string(actionBlock.Type), "actions") |
| 16 | assert.Equal(t, actionBlock.BlockID, "test") |
| 17 | assert.Equal(t, len(actionBlock.Elements.ElementSet), 1) |
| 18 | |
| 19 | } |