2026-02-16 23:43:26 +00:00
|
|
|
package html
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"testing"
|
|
|
|
|
|
|
|
|
|
i18n "forge.lthn.ai/core/go-i18n"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func TestIntegration_RenderThenReverse(t *testing.T) {
|
|
|
|
|
svc, _ := i18n.New()
|
|
|
|
|
i18n.SetDefault(svc)
|
|
|
|
|
ctx := NewContext()
|
|
|
|
|
|
|
|
|
|
page := NewLayout("HCF").
|
|
|
|
|
H(El("h1", Text("Building project"))).
|
|
|
|
|
C(El("p", Text("Files deleted successfully"))).
|
|
|
|
|
F(El("small", Text("Completed")))
|
|
|
|
|
|
2026-02-17 00:14:04 +00:00
|
|
|
imp := Imprint(page, ctx)
|
2026-02-16 23:43:26 +00:00
|
|
|
|
|
|
|
|
if imp.UniqueVerbs == 0 {
|
|
|
|
|
t.Error("reversal found no verbs in rendered page")
|
|
|
|
|
}
|
|
|
|
|
if imp.TokenCount == 0 {
|
|
|
|
|
t.Error("reversal produced empty imprint")
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-17 00:14:04 +00:00
|
|
|
func TestIntegration_ResponsiveImprint(t *testing.T) {
|
|
|
|
|
svc, _ := i18n.New()
|
|
|
|
|
i18n.SetDefault(svc)
|
|
|
|
|
ctx := NewContext()
|
|
|
|
|
|
|
|
|
|
r := NewResponsive().
|
|
|
|
|
Variant("desktop", NewLayout("HLCRF").
|
|
|
|
|
H(El("h1", Text("Building project"))).
|
|
|
|
|
L(El("nav", Text("Deleted files"))).
|
|
|
|
|
C(El("p", Text("Files deleted successfully"))).
|
|
|
|
|
R(El("aside", Text("Completed"))).
|
|
|
|
|
F(El("small", Text("Completed")))).
|
|
|
|
|
Variant("mobile", NewLayout("C").
|
|
|
|
|
C(El("p", Text("Files deleted successfully"))))
|
|
|
|
|
|
|
|
|
|
imp := Imprint(r, ctx)
|
|
|
|
|
|
|
|
|
|
if imp.TokenCount == 0 {
|
|
|
|
|
t.Error("responsive imprint produced zero tokens")
|
|
|
|
|
}
|
|
|
|
|
if imp.UniqueVerbs == 0 {
|
|
|
|
|
t.Error("responsive imprint found no verbs")
|
2026-02-16 23:43:26 +00:00
|
|
|
}
|
|
|
|
|
}
|