z_26_a_filetest.gno

0.72 Kb ยท 39 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	user  = std.Address("g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5")
13)
14
15var bid boards2.BoardID
16
17func init() {
18	testing.SetRealm(std.NewUserRealm(owner))
19	bid = boards2.CreateBoard(cross, "test123", false)
20
21	testing.SetRealm(std.NewUserRealm(user))
22	boards2.RequestInvite(cross, bid)
23}
24
25func main() {
26	testing.SetRealm(std.NewUserRealm(owner))
27
28	boards2.AcceptInvite(cross, bid, user)
29
30	println(boards2.IsMember(bid, user))
31	println()
32	println(boards2.Render("test123/invites"))
33}
34
35// Output:
36// true
37//
38// # test123 Invite Requests
39// ### Board has no invite requests