docs_test.gno
0.46 Kb ยท 22 lines
1package docs
2
3import (
4 "strings"
5 "testing"
6)
7
8func TestRenderHome(t *testing.T) {
9 output := Render("")
10
11 // Check for the presence of key sections
12 if !contains(output, "# Gno Examples Documentation") {
13 t.Errorf("Render output is missing the title.")
14 }
15 if !contains(output, "Official documentation") {
16 t.Errorf("Render output is missing the official documentation link.")
17 }
18}
19
20func contains(s, substr string) bool {
21 return strings.Index(s, substr) >= 0
22}