medium.rip/pkg/converters/paragraph_converter_test.go
Sphericalkat 7b6e7d7edb feat: implement markup rendering
Signed-off-by: Sphericalkat <amolele@gmail.com>
2023-05-28 16:13:44 +05:30

22 lines
496 B
Go

package converters
import (
"testing"
"github.com/medium.rip/pkg/entities"
)
func TestConvertOli(t *testing.T) {
oli := entities.Paragraph{
Name: "1-1",
Type: "OLI",
Text: "This is an ordered list item.",
Markups: []entities.Markup{},
}
olis := []entities.Paragraph{oli}
oliHTML := ConvertParagraphs(olis)
expected := "<ol><li>This is an ordered list item.</li></ol>"
if oliHTML != expected {
t.Errorf("ConvertParagraphs(olis) = %s; want %s", oliHTML, expected)
}
}