Skip to content

[TESTING] Write Unit Tests for Invoice Token Allowance Expirations #141

Description

@chizzy192

[TESTING] Issue

Metadata

Field Value
Domain Testing
Difficulty Medium (4 Days)
Effort Estimate effort: 7h
Priority P2-Medium
Labels enhancement
Target Branch dev
Depends On None

🎯 Context & Goal

Comprehensive test coverage is mandatory for smart contract security.

This issue adds tests in contracts/invoice-token within test.rs to validate behavior under edge cases and unexpected inputs.

Ensuring robust test coverage prevents regression bugs during contract upgrades.

📂 Target Files

  • contracts/invoice-token/src/test.rs → test_runner

📋 Implementation Tasks

  • Task 1: Write test functions in contracts/invoice-token/src/test.rs.
  • Task 2: Assert proper error code emissions on failure paths.
  • Task 3: Verify state storage persistence after execution.
  • Task 4: Ensure all workspace tests pass with cargo test --all.

🛠️ Technical Guidance

#[test]
fn test_contract_scenario() {
    let env = Env::default();
    // Test logic here
}

🔗 References & Related

  • Test file: contracts/invoice-token/src/test.rs

⏳ Delivery Window

This issue should be completed within 4 day(s) of assignment.

Contribution Workflow

  1. Branch off dev: git checkout -b feature/issue-implementation dev
  2. Implement all tasks in the checklist above.
  3. Run all CI checks locally (see DEVELOPMENT.md).
  4. Open a Pull Request targeting dev.
  5. Link this issue in your PR description.

✅ Acceptance Criteria

  • All implementation tasks above are completed cleanly.
  • Code compiles without warnings or errors.
  • All existing tests continue to pass.
  • New unit tests cover all modified code paths.
  • PR strictly targets the dev branch.
  • Code follows project style guidelines (cargo fmt and cargo clippy).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Stellar WaveIssues in the Stellar wave programenhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions