Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_21_b_filetest.gno

0.65 Kb ยท 31 lines
 1package main
 2
 3import (
 4	"strings"
 5	"testing"
 6
 7	boards2 "gno.land/r/gnoland/boards2/v1"
 8)
 9
10const owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
11
12func init() {
13	// Set an initial message so it can be cleared
14	testing.SetRealm(testing.NewUserRealm(owner))
15	boards2.SetRealmNotice(cross, "This is a test realm message")
16}
17
18func main() {
19	testing.SetRealm(testing.NewUserRealm(owner))
20
21	boards2.SetRealmNotice(cross, "")
22
23	// Render content must contain the message
24	content := boards2.Render("")
25	println(strings.HasPrefix(content, "> This is a test realm message\n\n"))
26	println(strings.HasPrefix(content, "# Boards"))
27}
28
29// Output:
30// false
31// true