-
Notifications
You must be signed in to change notification settings - Fork 108
[contract] Add 3 Tests to invite_tests.rs (Part 1)Β #526
Copy link
Copy link
Open
Description
π Overview
Expand test coverage for the invite module by adding 3 new tests (Part 1 of 2).
β Tasks
- Add 3 new test functions to
contract/tests/invite_tests.rs - Follow existing test patterns and helper functions
- Verify all tests pass
π§ͺ New Tests (3 total)
Test 1: Invite Code Expiration
#[test]
fn test_invite_code_expiration() {
// Generate invite code with expiration
// Advance time past expiration
// Try to use code
// Should fail with expired error
}Test 2: Invite Code Usage Limit
#[test]
fn test_invite_code_usage_limit_reached() {
// Generate code with max_uses = 2
// Use code twice successfully
// Try to use third time
// Should fail with limit reached error
}Test 3: Multiple Invite Codes Per Market
#[test]
fn test_multiple_invite_codes_per_market() {
// Generate multiple codes for same market
// Verify each works independently
// Verify usage tracking is separate
}π Verification
- All 3 tests written
- All tests pass
- Tests follow existing patterns
- No clippy warnings
Reactions are currently unavailable