-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[r/boards] [meta] tests #3623
Comments
@jeronimoalbi @x1unix you can add your name beside the functions in issue description. |
This was referenced Jan 28, 2025
jeronimoalbi
added a commit
that referenced
this issue
Jan 28, 2025
Add a missing filetests for `CreateBoard()` function. Related to #3623 This covers all tests for the function: - Creation success - Fail w/ empty board name - Fail w/ existing board name - Fail w/ non user call - Fail w/ an address as board name - Fail because name is registered and not owned in `users` realm - Fail w/ short name - Creation success with owned name registered in `users` realm - Fail for non realm DAO member
jeronimoalbi
added a commit
that referenced
this issue
Jan 28, 2025
Add a missing filetests for `RenameBoard()` function. Related to #3623. This covers all tests for the function: - Rename success by default board owner - Fail w/ empty board name - Fail w/ existing board name - Fail when renaming unexisting board - Fail w/ an address as board name - Rename success by another board owner - Fail because name is registered and not owned in `users` realm - Fail w/ short name - Rename success with owned name registered in `users` realm - Fail for non board DAO member
This was referenced Jan 29, 2025
jeronimoalbi
added a commit
that referenced
this issue
Jan 30, 2025
Add missing filetests for `InviteMember()` function. Related to #3623 This covers all tests for the function: - Invite to realm success - Fail when admin invites a new realm owner - Success when admin invites a new realm admin - Fail w/ invalid invite role - Invite to board success - Fail w/ existing user - Fail for non member (unauthorized)
jeronimoalbi
added a commit
that referenced
this issue
Jan 30, 2025
Add missing filetests for `RemoveMember()` function. Related to #3623 This covers all tests for the function: - Success removing a realm member - Fail for non member (unauthorized) - Fail w/ unexisting user
jeronimoalbi
added a commit
that referenced
this issue
Jan 30, 2025
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)
jeronimoalbi
added a commit
that referenced
this issue
Jan 30, 2025
Add missing filetests for`HasMemberRole()` and `IsMember()` functions. Related to #3623 This covers all tests for the function: - Successfully check valid member - Successfully check non member
This was referenced Jan 30, 2025
jeronimoalbi
added a commit
that referenced
this issue
Jan 30, 2025
Add missing filetests for `CreateThread()` function. Related to #3623 This covers all tests for the function: - Successfully create a thread - Fail because board is not found - Fail because user has no permission to create a thread - Fail w/ empty title - Fail w/ empty body
jeronimoalbi
added a commit
that referenced
this issue
Jan 31, 2025
Add missing filetests for `EditThread()` function. Related to #3623 This covers all tests for the function: - Successfully edit a thread - Fail w/ empty title - Fail w/ empty body - Fail because board is not found - Fail because thread is not found - Fail because user has no permission to edit a thread - Successfully edit a thread using a user with permission to delete
jeronimoalbi
added a commit
that referenced
this issue
Jan 31, 2025
Add missing filetests for `FlagThread()` function. Related to #3623 This covers all tests for the function: - Successfully flag a thread - Fail because board is not found - Fail because user has no permission to flag a thread - Fail because thread is not found - Fail because default flag threshold of 1 is exceeded - Successfully flag a thread using a user with permission to flag
jeronimoalbi
added a commit
that referenced
this issue
Jan 31, 2025
Add missing filetests for `DeleteThread()` function. Related to #3623 This covers all tests for the function: - Successfully delete a thread - Fail because board is not found - Fail because thread is not found - Fail because user has no permission to delete a thread - Successfully delete a thread using a user with permission to delete
jeronimoalbi
added a commit
that referenced
this issue
Jan 31, 2025
Add missing filetests for `GetBoardIDFromName()` function. Related to #3623 This covers all tests for the function: - Successfully get ID by name - Fail because name is not found
This was referenced Jan 31, 2025
jeronimoalbi
added a commit
that referenced
this issue
Jan 31, 2025
Add missing filetests for `CreateReply()` function. Related to #3623 This covers all tests for the function: - Successfully create a reply - Fail because board is not found - Fail because thread is not found - Fail because parent reply is not found - Fail because thread is hidden - Fail creating sub-reply because thread is hidden - Fail creating sub-reply because parent reply is hidden - Fail because user has no permission to create a reply - Fail w/ empty body - Successfully create a sub-reply
This was referenced Jan 31, 2025
This was referenced Jan 31, 2025
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Context:
This META issue tracks filetest coverage for all publicly callable methods in the boards realm.
Each checkbox corresponds to creating filetests (or updating existing ones) that thoroughly cover that function’s logic and edge cases.
render.gno
:Render(path string) string
?page=...
; test out-of-bounds pages.public.gno
:GetBoardIDFromName(name string) (BoardID, bool)
@jeronimoalbiCreateBoard(name string) BoardID
@jeronimoalbiboard:create
. Unauthorized → panic.RenameBoard(name, newName string)
@jeronimoalbinewName
used, panic “board already exists.”<6 chars
or address-like → panic.FlagThread(bid BoardID, postID PostID, reason string)
@jeronimoalbithread:flag
.thread:flag
.CreateThread(bid BoardID, title, body string) PostID
@jeronimoalbithread:create
.render
pagination.CreateReply(bid BoardID, threadID, replyID PostID, body string) PostID
@jeronimoalbithread:create
or any member.replyID != threadID
, replying to another reply.FlagReply(bid BoardID, threadID, replyID PostID, reason string)
@jeronimoalbireply:flag
.CreateRepost(bid BoardID, threadID PostID, title, body string, dstBoardID BoardID) PostID
@x1unixthread:repost
.DeleteThread(bid BoardID, threadID PostID)
@jeronimoalbithread:delete
.DeleteReply(bid BoardID, threadID, replyID PostID)
@jeronimoalbireply:delete
.EditThread(bid BoardID, threadID PostID, title, body string)
@jeronimoalbithread:edit
or thread owner.EditReply(bid BoardID, threadID, replyID PostID, title, body string)
@jeronimoalbiInviteMember(bid BoardID, user std.Address, role Role)
@jeronimoalbimember:invite
; unauthorized → panic.RemoveMember(bid BoardID, user std.Address)
@jeronimoalbimember:remove
.HasMemberRole(bid BoardID, member std.Address, role Role) bool
@jeronimoalbiChangeMemberRole(bid BoardID, member std.Address, role Role)
@jeronimoalbirole:change
.Cross-Cutting Scenarios (Concurrency, Fuzzing, Load):
Some scenarios apply globally across multiple functions:
We can incorporate these into existing filetests (for example, a filetest that tries to create 1,000 threads or random board names), or separate them out if that’s simpler.
Notes:
The text was updated successfully, but these errors were encountered: