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