feat(mail): draft, attach, and draft-invoice CLI
Save OO Mail drafts via body field, attach Files documents, and one-shot invoice PDF regenerate + draft for client billing emails.
This commit is contained in:
+24
-1
@@ -1,6 +1,9 @@
|
||||
package onlyoffice
|
||||
|
||||
import "testing"
|
||||
import (
|
||||
"strings"
|
||||
"testing"
|
||||
)
|
||||
|
||||
func TestResolveMailFolder(t *testing.T) {
|
||||
tests := []struct {
|
||||
@@ -70,3 +73,23 @@ func TestMailMessagesAsTableRows(t *testing.T) {
|
||||
t.Fatalf("got %+v", rows[0])
|
||||
}
|
||||
}
|
||||
|
||||
func TestPlainTextToMailHTML(t *testing.T) {
|
||||
got := PlainTextToMailHTML("Hello\n\nWorld\nline2")
|
||||
if !strings.Contains(got, "<p>Hello</p>") || !strings.Contains(got, "World<br/>line2") {
|
||||
t.Fatalf("got %q", got)
|
||||
}
|
||||
html := "<p>Already</p>"
|
||||
if PlainTextToMailHTML(html) != html {
|
||||
t.Fatalf("html passthrough failed")
|
||||
}
|
||||
}
|
||||
|
||||
func TestInt64FromMap(t *testing.T) {
|
||||
if Int64FromMap(map[string]any{"id": float64(99)}, "id") != 99 {
|
||||
t.Fatal("float64")
|
||||
}
|
||||
if Int64FromMap(map[string]any{"id": "42"}, "id") != 42 {
|
||||
t.Fatal("string")
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user