Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_2_k_filetest.gno

0.75 Kb ยท 36 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	boards2 "gno.land/r/gnoland/boards2/v1"
 7)
 8
 9const (
10	owner   address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
11	comment         = "Second comment"
12)
13
14var (
15	bid      boards2.BoardID
16	tid, rid boards2.PostID
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, "Parent comment")
24
25	// Flag parent post so it's hidden
26	boards2.FlagReply(cross, bid, tid, rid, "")
27}
28
29func main() {
30	testing.SetRealm(testing.NewUserRealm(owner))
31
32	boards2.CreateReply(cross, bid, tid, rid, "Sub comment")
33}
34
35// Error:
36// replying to a hidden or frozen reply is not allowed