Skip to content

[contract] Add 3 Tests to invite_tests.rs (Part 1)Β #526

@Olowodarey

Description

@Olowodarey

πŸ“‹ 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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions