Skip to content

Commit 22cf13a

Browse files
committed
Add: test_file for GridRender
1 parent 30f9cfc commit 22cf13a

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
package gnopub
2+
3+
import (
4+
"strings"
5+
"testing"
6+
)
7+
8+
// Test for basic grid rendering
9+
func TestRenderGrid(t *testing.T) {
10+
got := RenderGrid()
11+
12+
if got == "" {
13+
t.Fatal("RenderGrid output is empty")
14+
}
15+
16+
if !strings.Contains(got, "svg") {
17+
t.Error("expected at least one SVG element in render output")
18+
}
19+
20+
if !strings.Contains(got, "BuyCells") {
21+
t.Error("expected 'BuyCells' tutorial step in render output")
22+
}
23+
24+
if !strings.Contains(got, "available") {
25+
t.Error("expected 'available' label for unowned cells")
26+
}
27+
}

0 commit comments

Comments
 (0)