-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathblock_context_test.go
More file actions
20 lines (16 loc) · 747 Bytes
/
block_context_test.go
File metadata and controls
20 lines (16 loc) · 747 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
package slack
import (
"testing"
"github.com/stretchr/testify/assert"
)
func TestNewContextBlock(t *testing.T) {
locationPinImage := NewImageBlockElement("https://api.slack.com/img/blocks/bkb_template_images/tripAgentLocationMarker.png", "Location Pin Icon")
textExample := NewTextBlockObject("plain_text", "Location: Central Business District", true, false)
elements := []MixedElement{locationPinImage, textExample}
contextBlock := NewContextBlock("test", elements...)
assert.Equal(t, contextBlock.BlockType(), MBTContext)
assert.Equal(t, string(contextBlock.Type), "context")
assert.Equal(t, contextBlock.BlockID, "test")
assert.Equal(t, contextBlock.ID(), "test")
assert.Equal(t, len(contextBlock.ContextElements.Elements), 2)
}