render_test.go
1package document
2
3import (
4 "bytes"
5 "context"
6 "encoding/json"
7 "os"
8 "testing"
9
10 "github.com/stretchr/testify/assert"
11 "github.com/stretchr/testify/require"
12)
13
14func TestRender(t *testing.T) {
15 content, err := os.ReadFile("testdata/test_list.json")
16 require.NoError(t, err)
17 var doc DocumentContent
18 assert.NoError(t, json.Unmarshal(content, &doc))
19 var b bytes.Buffer
20 DocumentComponent(doc).Render(context.Background(), &b)
21 t.Log(b.String())
22}