Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_26_b_filetest.gno

0.81 Kb ยท 38 lines
 1package main
 2
 3import (
 4	"testing"
 5
 6	"gno.land/p/gnoland/boards"
 7
 8	boards2 "gno.land/r/boards000/v1rc1"
 9)
10
11const (
12	owner address = "g16jpf0puufcpcjkph5nxueec8etpcldz7zwgydq" // @devx
13	user  address = "g1vh7krmmzfua5xjmkatvmx09z37w34lsvd2mxa5"
14)
15
16var bid boards.ID
17
18func init() {
19	testing.SetRealm(testing.NewUserRealm(owner))
20	bid = boards2.CreateBoard(cross, "test123", false)
21
22	// Request an invite as a user that is not a member
23	testing.SetRealm(testing.NewUserRealm(user))
24	boards2.RequestInvite(cross, bid)
25
26	// Add user as a member idependently of the invite request
27	testing.SetRealm(testing.NewUserRealm(owner))
28	boards2.InviteMember(cross, bid, user, boards2.RoleGuest)
29}
30
31func main() {
32	testing.SetRealm(testing.NewUserRealm(owner))
33
34	boards2.AcceptInvite(cross, bid, user)
35}
36
37// Error:
38// user is already a member