Search Apps Documentation Source Content File Folder Download Copy Actions Download

z_5_d_filetest.gno

0.72 Kb ยท 36 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 = "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj" // @test2
14)
15
16var bid boards.ID // Operate on board DAO
17
18func init() {
19	testing.SetRealm(testing.NewUserRealm(owner))
20	bid = boards2.CreateBoard(cross, "test123", false)
21
22	boards2.InviteMember(cross, bid, user, boards2.RoleGuest)
23}
24
25func main() {
26	testing.SetRealm(testing.NewUserRealm(user))
27
28	// Users must be able to remove themselves without permissions
29	boards2.RemoveMember(cross, bid, user)
30
31	// Check that user is not a member
32	println(boards2.IsMember(bid, user))
33}
34
35// Output:
36// false