Codebase list golang-github-nlopes-slack / upstream/0.6.0+dfsg block_action_test.go
upstream/0.6.0+dfsg

Tree @upstream/0.6.0+dfsg (Download .tar.gz)

block_action_test.go @upstream/0.6.0+dfsgraw · history · blame

package slack

import (
	"testing"

	"github.com/stretchr/testify/assert"
)

func TestNewActionBlock(t *testing.T) {

	approveBtnTxt := NewTextBlockObject("plain_text", "Approve", false, false)
	approveBtn := NewButtonBlockElement("", "click_me_123", approveBtnTxt)

	actionBlock := NewActionBlock("test", approveBtn)
	assert.Equal(t, string(actionBlock.Type), "actions")
	assert.Equal(t, actionBlock.BlockID, "test")
	assert.Equal(t, len(actionBlock.Elements.ElementSet), 1)

}