z_10_a_filetest.gno
0.86 Kb ยท 40 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 moderator = address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj") // @test2
12)
13
14var (
15 bid boards2.BoardID
16 pid boards2.PostID
17)
18
19func init() {
20 testing.SetRealm(testing.NewUserRealm(owner))
21 bid = boards2.CreateBoard(cross, "test-board", false)
22
23 // Invite a moderator to the new board
24 boards2.InviteMember(cross, bid, moderator, boards2.RoleModerator)
25
26 // Create a new thread as a moderator
27 pid = boards2.CreateThread(cross, bid, "Foo", "bar")
28}
29
30func main() {
31 testing.SetRealm(testing.NewUserRealm(owner))
32
33 boards2.FlagThread(cross, bid, pid, "")
34
35 // Ensure that original thread content not visible
36 println(boards2.Render("test-board/1"))
37}
38
39// Output:
40// Thread with ID: 1 has been flagged as inappropriate