Skip to content

[contract] Add 3 Tests to invite_tests.rs (Part 2)Β #527

@Olowodarey

Description

@Olowodarey

πŸ“‹ Overview

Expand test coverage for the invite module by adding 3 new tests (Part 2 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: Revoke Invite Code

#[test]
fn test_revoke_invite_code() {
    // Generate invite code
    // Revoke code
    // Try to use revoked code
    // Should fail
}

Test 2: Invite Code for Resolved Market

#[test]
fn test_use_invite_code_resolved_market() {
    // Generate invite code
    // Resolve market
    // Try to use code
    // Should fail with market expired error
}

Test 3: List All Invite Codes

#[test]
fn test_list_invite_codes_for_market() {
    // Generate multiple codes for market
    // List all codes
    // Verify all are returned with correct details
}

πŸ” 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