-
Notifications
You must be signed in to change notification settings - Fork 0
/
table_footer_test.go
32 lines (26 loc) · 817 Bytes
/
table_footer_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
package textractor
import (
"testing"
"github.com/aws/aws-sdk-go-v2/service/textract/types"
"github.com/stretchr/testify/assert"
)
func TestTableFooter(t *testing.T) {
// Mock data
word1 := &Word{text: "First", textType: types.TextTypePrinted}
word2 := &Word{text: "Footer", textType: types.TextTypePrinted}
words := []*Word{word1, word2}
// Create a TableFooter instance
tableFooter := &TableFooter{
base: base{
id: "footer-1",
confidence: 0.95,
blockType: types.BlockTypeTableFooter,
},
words: words,
}
// Test Words method
assert.Equal(t, words, tableFooter.Words(), "Words method should return the correct words")
// Test Text method
expectedText := "First Footer"
assert.Equal(t, expectedText, tableFooter.Text(), "Text method should return the concatenated text")
}