z_0_j_filetest.gno

1.36 Kb · 44 lines
 1package main
 2
 3import (
 4	"std"
 5	"testing"
 6
 7	boards2 "gno.land/r/gnoland/boards2/v1"
 8)
 9
10const (
11	owner = std.Address("g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq") // @devx
12	name  = "TestBoard"
13)
14
15func main() {
16	testing.SetRealm(std.NewUserRealm(owner))
17
18	boards2.CreateBoard(cross, name, false)
19
20	// Unlisted board should not be rendered
21	println(boards2.Render(""))
22
23	// Unlisted board can be rendered by path
24	println("\n==================")
25	println(boards2.Render(name))
26}
27
28// Output:
29// # Boards
30// [Create Board](/r/gnoland/boards2/v1$help&func=CreateBoard&listed=true&name=) • [List Admin Users](/r/gnoland/boards2/v1:admin-users) • [Help](/r/gnoland/boards2/v1:help)
31//
32// ---
33// ### Currently there are no boards
34// Be the first to [create a new board](/r/gnoland/boards2/v1$help&func=CreateBoard&listed=true&name=) !
35//
36// ==================
37// # TestBoard
38// Board created by [g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq](/u/g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq) on 2009-02-13 11:31pm UTC, #1
39//
40// [Create Thread](/r/gnoland/boards2/v1$help&func=CreateThread&boardID=1&body=&title=) • [Request Invite](/r/gnoland/boards2/v1$help&func=RequestInvite&boardID=1) • [Manage Board](?menu=manageBoard)
41//
42// ---
43// ### This board doesn't have any threads
44// Do you want to [start a new conversation](/r/gnoland/boards2/v1$help&func=CreateThread&boardID=1&body=&title=) in this board ?