| 1 | package slack |
| 2 | |
| 3 | import ( |
| 4 | "testing" |
| 5 | |
| 6 | "github.com/stretchr/testify/assert" |
| 7 | ) |
| 8 | |
| 9 | func TestNewHeaderBlock(t *testing.T) { |
| 10 | |
| 11 | textInfo := NewTextBlockObject("plain_text", "This is quite the header", false, false) |
| 12 | |
| 13 | headerBlock := NewHeaderBlock(textInfo, HeaderBlockOptionBlockID("test_block")) |
| 14 | assert.Equal(t, string(headerBlock.Type), "header") |
| 15 | assert.Equal(t, headerBlock.BlockID, "test_block") |
| 16 | assert.Equal(t, headerBlock.Text.Type, "plain_text") |
| 17 | assert.Contains(t, headerBlock.Text.Text, "quite the header") |
| 18 | } |