v4/templates/layouts/main_test.go

16 lines
558 B
Go

package layouts_test
import (
"testing"
"git.sapphic.engineer/roleypoly/v4/templates/templatetesting"
"github.com/stretchr/testify/assert"
)
func TestMainLayout(t *testing.T) {
r := templatetesting.Template(t, "components/blank", struct{ HeadTitle string }{HeadTitle: "roleypoly"}, "layouts/main")
assert.Contains(t, r, "<nav>", "loaded navigation (open)")
assert.Contains(t, r, "</nav>", "loaded navigation (close)")
assert.Contains(t, r, "<title>roleypoly</title>", "sets title")
assert.Contains(t, r, "<h1>hello world</h1>", "has {{embed}}")
}