-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test(boards2): add missing filetests for member role change (#3636)
Add missing filetests for `ChangeMemberRole()` function. Related to #3623 This covers all tests for the function: - Successful role change for realm member - Successful role change for board member - Fail for an admin removing an owner role - Fail for an admin changing a role to owner - Success changing a role to owner by another owner - Fail when role doesn't exist - Fail when user is not found - Fail for non member (unauthorized)
- Loading branch information
1 parent
dc173c2
commit 63007ab
Showing
6 changed files
with
47 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package main | ||
|
||
import ( | ||
"std" | ||
|
||
"gno.land/r/nt/boards2" | ||
) | ||
|
||
const owner = std.Address("g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj") // @test2 | ||
|
||
func init() { | ||
std.TestSetOrigCaller(owner) | ||
} | ||
|
||
func main() { | ||
boards2.ChangeMemberRole(0, "g1us8428u2a5satrlxzagqqa5m6vmuze025anjlj", boards2.RoleGuest) | ||
} | ||
|
||
// Error: | ||
// unauthorized |