Open
Description
📝 Add Unit Tests for BeastSkill Model
🔍 Scope
Create unit tests for the BeastSkill model to validate skill assignment to beasts and skill validation functionality used in the store's init_beast_skills()
method.
🔄 How to Implement the Issue
- Add
#[cfg(test)]
module tomodels/beast_skill.cairo
- Test BeastSkill struct creation and validation
- Test skill assignment for different beast types (Light, Magic, Shadow)
- Test edge cases for empty/invalid skill lists
- Test skill ID validation within spans
✅ Acceptance Criteria
- Test BeastSkill struct initialization with valid skill spans
- Test skill assignment for Light beast type (Beam, Slash, Pierce, Wave)
- Test skill assignment for Magic beast type (Blast, Freeze, Burn, Punch)
- Test skill assignment for Shadow beast type (Smash, Crush, Shock, Kick)
- Test edge cases with empty skill spans
- Test skill ID validation within the spans
- All tests pass with
sozo test
📸 Additional Context
BeastSkill model currently has no tests but is used extensively in:
store.cairo
init_beast_skills()
method- Beast skill validation throughout the game
- Each beast type has 4 specific skills assigned
Contribution Guidelines
- Please ensure you read and follow the contribution guidelines in the project's README file