Skip to content

Commit 4e84670

Browse files
authored
chore: add test for section block expand option (#1440)
2 parents 0a4d234 + f3370d0 commit 4e84670

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

block_section_test.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,19 @@ func TestNewBlockSectionContainsAddedTextBlockAndAccessory(t *testing.T) {
3434
assert.False(t, textBlockInSection.Verbatim)
3535
assert.Equal(t, sectionBlock.Accessory.ImageElement, conflictImage)
3636
}
37+
38+
func TestSectionBlockOptionExpand(t *testing.T) {
39+
textInfo := NewTextBlockObject("mrkdwn", "This is a long text that should be auto-expanded", false, false)
40+
41+
// Create a section block with expand option set to true
42+
sectionBlock := NewSectionBlock(textInfo, nil, nil, SectionBlockOptionExpand(true))
43+
44+
// Verify that the expand field is set correctly
45+
assert.True(t, sectionBlock.Expand)
46+
47+
// Create another section block with expand option set to false
48+
sectionBlock = NewSectionBlock(textInfo, nil, nil, SectionBlockOptionExpand(false))
49+
50+
// Verify that the expand field is set correctly
51+
assert.False(t, sectionBlock.Expand)
52+
}

0 commit comments

Comments
 (0)