Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_13_a_filetest.gno

0.80 Kb · 37 lines
 1package main
 2
 3import (
 4	"strings"
 5	"testing"
 6
 7	"gno.land/p/gnoland/boards"
 8
 9	boards2 "gno.land/r/boards000/v1rc1"
10)
11
12const owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13
14var (
15	bid      boards.ID
16	rid, tid boards.ID
17)
18
19func init() {
20	testing.SetRealm(testing.NewUserRealm(owner))
21	bid = boards2.CreateBoard(cross, "test-board", false)
22	tid = boards2.CreateThread(cross, bid, "Foo", "bar")
23	rid = boards2.CreateReply(cross, bid, tid, 0, "body")
24}
25
26func main() {
27	testing.SetRealm(testing.NewUserRealm(owner))
28
29	boards2.FlagReply(cross, bid, tid, rid, "")
30
31	// Render content must contain a message about the hidden reply
32	content := boards2.Render("test-board/1/2")
33	println(strings.Contains(content, "\n> *⚠ Reply is hidden as it has been flagged as inappropriate*\n"))
34}
35
36// Output:
37// true