Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_ui_4_f_filetest.gno

0.78 Kb ยท 37 lines
 1// Render thread which has been flagged.
 2package main
 3
 4import (
 5	"testing"
 6
 7	"gno.land/p/gnoland/boards"
 8
 9	boards2 "gno.land/r/boards000/v1rc1"
10)
11
12const (
13	owner     address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
14	boardName         = "BoardName"
15)
16
17var threadID boards.ID
18
19func init() {
20	testing.SetRealm(testing.NewUserRealm(owner))
21
22	// Create a readonly board and then add a thread
23	boardID := boards2.CreateBoard(cross, boardName, false)
24	threadID = boards2.CreateThread(cross, boardID, "Foo", "Body")
25
26	// Flag the thread
27	boards2.SetFlaggingThreshold(cross, boardID, 1)
28	boards2.FlagThread(cross, boardID, threadID, "")
29}
30
31func main() {
32	path := boardName + "/" + threadID.String()
33	println(boards2.Render(path))
34}
35
36// Output:
37// Thread with ID: 1 has been flagged as inappropriate