Skip to content Search Apps Documentation Source Content Run Reset Eval Playground File Folder Download Copy Actions State String Boolean Number Struct Map Slice Pointer Function Closure Reference Nil Package Type Interface Unknown

z_create_board_08_filetest.gno

1.41 Kb · 44 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v0/filetests/z_create_board_08_filetest
 2
 3package z_create_board_08_filetest
 4
 5import (
 6	"testing"
 7
 8	boards2 "gno.land/r/gnoland/boards2/v0"
 9)
10
11const (
12	owner address = "g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx"
13	name          = "TestBoard"
14)
15
16func main(cur realm) {
17	testing.SetRealm(testing.NewUserRealm(owner))
18
19	boards2.CreateBoard(cross(cur), name, false, false)
20
21	// Unlisted board should not be rendered
22	println(boards2.Render(""))
23
24	// Unlisted board can be rendered by path
25	println("\n==================")
26	println(boards2.Render(name))
27}
28
29// Output:
30// # Boards
31// [Create Board](/r/gnoland/boards2/v0:create-board) • [List Admin Users](/r/gnoland/boards2/v0:admin-users) • [Help](/r/gnoland/boards2/v0:help)
32//
33// ---
34// ### Currently there are no boards
35// Be the first to [create a new board](/r/gnoland/boards2/v0:create-board)!
36//
37// ==================
38// # [Boards](/r/gnoland/boards2/v0) › TestBoard
39// Created by [g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx](/u/g1skl80cuz8zq3lul9pgz5pc35l2pfzgxgfpsqkx) on 2009-02-13 11:31pm UTC, #1
40// ↳ [Create Thread](/r/gnoland/boards2/v0:TestBoard/create-thread) • [Request Invite](/r/gnoland/boards2/v0$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/v0:TestBoard/create-thread) in this board?