Codebase list golang-github-nlopes-slack / run/33fb859d-7349-4038-abd4-9c43e3922006/main block_action_test.go
run/33fb859d-7349-4038-abd4-9c43e3922006/main

Tree @run/33fb859d-7349-4038-abd4-9c43e3922006/main (Download .tar.gz)

block_action_test.go @run/33fb859d-7349-4038-abd4-9c43e3922006/mainraw · 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)

}