Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_create_board_08_filetest.gno

1.41 Kb · 44 lines
 1// PKGPATH: gno.land/r/gnoland/boards2/v1/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/v1"
 9)
10
11const (
12	owner address = "g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh"
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/v1:create-board) • [List Admin Users](/r/gnoland/boards2/v1:admin-users) • [Help](/r/gnoland/boards2/v1:help)
32//
33// ---
34// ### Currently there are no boards
35// Be the first to [create a new board](/r/gnoland/boards2/v1:create-board)!
36//
37// ==================
38// # [Boards](/r/gnoland/boards2/v1) › TestBoard
39// Created by [g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh](/u/g1rp7cmetn27eqlpjpc4vuusf8kaj746tysc0qgh) on 2009-02-13 11:31pm UTC, #1
40// ↳ [Create Thread](/r/gnoland/boards2/v1:TestBoard/create-thread) • [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:TestBoard/create-thread) in this board?