MCPcopy Create free account
hub / github.com/basecamp/hey-cli / TestToTextActionTextAttachment

Function TestToTextActionTextAttachment

internal/htmlutil/htmlutil_test.go:77–88  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

75}
76
77func TestToTextActionTextAttachment(t *testing.T) {
78 got := ToText(`<p>Text</p><action-text-attachment filename="photo.png"><img src="url"></action-text-attachment><p>More</p>`)
79 if !strings.Contains(got, "[photo.png]") {
80 t.Errorf("ToText should show filename for action-text-attachment, got %q", got)
81 }
82 if !strings.Contains(got, "Text") || !strings.Contains(got, "More") {
83 t.Errorf("ToText should include surrounding text, got %q", got)
84 }
85 if strings.Contains(got, "[image]") {
86 t.Errorf("ToText should skip inner content of action-text-attachment, got %q", got)
87 }
88}
89
90func TestToTextTrixFigure(t *testing.T) {
91 got := ToText(`<p>Before</p><figure data-trix-attachment='{"filename":"photo.png","url":"/img.png","contentType":"image/png"}'></figure><p>After</p>`)

Callers

nothing calls this directly

Calls 1

ToTextFunction · 0.85

Tested by

no test coverage detected