Skip to content

Commit

Permalink
use testutils in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irreverentsimplicity committed Oct 5, 2024
1 parent e66b39c commit 36c276e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 5 deletions.
6 changes: 6 additions & 0 deletions examples/gno.land/p/demo/zteams/gno.mod
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
module gno.land/p/demo/zteams

require (
gno.land/p/demo/avl v0.0.0-latest
gno.land/p/demo/testutils v0.0.0-latest
gno.land/p/demo/users v0.0.0-latest
)
2 changes: 1 addition & 1 deletion examples/gno.land/p/demo/zteams/teams.gno
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func (tm *TeamManager) RemoveAdmin(teamAddress std.Address, userAddress std.Addr
return err
}

if !teamm.isOwner(requester) {
if !team.isOwner(requester) {
return ErrNotOwner
}

Expand Down
9 changes: 5 additions & 4 deletions examples/gno.land/p/demo/zteams/teams_test.gno
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,30 @@ package zteams

import (
"std"
"gno.land/p/demo/testutils"
"gno.land/p/demo/users"
"testing"
)

// Helper function to create a sample user.
func createUser(address string) users.User {
return users.User{
Address: std.Address(address),
Address: testutils.TestAddress(address),
Name: "Test User",
Profile: "Sample profile",
Number: 1,
Invites: 1,
Inviter: std.Address("inviter"),
Inviter: testutils.TestAddress("inviter"),
}
}

// Helper function to create a sample team.
func createTeam(address, owner string) *Team {
return &Team{
Address: std.Address(address),
Address: testutils.TestAddress(address),
TeamName: "Test Team",
TeamProfile: "This is a test team profile",
Owner: std.Address(owner),
Owner: testutils.TestAddress(owner),
Admins: make(map[string]bool), // Updated to use string keys
Disbursers: make(map[string]bool), // Updated to use string keys
}
Expand Down

0 comments on commit 36c276e

Please sign in to comment.