go-html/integration_test.go
Snider c525437ed6
Some checks failed
Security Scan / security (pull_request) Successful in 9s
Test / test (pull_request) Failing after 20s
refactor(module): migrate module path from forge.lthn.ai to dappco.re
Update module path from forge.lthn.ai/core/go-html to dappco.re/go/core/html.
Migrate all .go import paths, update dependency versions (core v0.5.0,
log v0.1.0, io v0.2.0), and add replace directives for local development.

Co-Authored-By: Virgil <virgil@lethean.io>
2026-03-22 01:28:30 +00:00

52 lines
1.2 KiB
Go

package html
import (
"testing"
i18n "dappco.re/go/core/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")))
imp := Imprint(page, ctx)
if imp.UniqueVerbs == 0 {
t.Error("reversal found no verbs in rendered page")
}
if imp.TokenCount == 0 {
t.Error("reversal produced empty imprint")
}
}
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")
}
}