What
Two test functions in tests/unit/progress_tests.rs reference non-existent helper functions and expect panic messages that don't match the actual contract code. These tests will not compile.
Why
The tests test_complete_module_non_existent_module_panics and test_submit_quiz_score_without_enrollment_panics call setup_tracker(&env) and create_test_course(&env, &client, &course_id) which don't exist. The actual functions are setup_contract(&env) and create_test_course(&env, &client). Additionally, the expected panic strings don't match:
- Test expects
"module does not belong to course" but contract panics with "module not found in course"
- Test expects
"learner is not enrolled in course" but contract panics with "not enrolled"
Scope
- Fix function references to use existing helper functions
- Update
#[should_panic(expected = "...")] attributes to match actual contract panic strings
- Verify tests compile and pass
Technical Context
- File:
tests/unit/progress_tests.rs (lines ~673-699)
- Contract panic strings:
progress-tracker/src/lib.rs (lines ~260, ~349)
- Actual helpers:
setup_contract(&env), create_test_course(&env, &client) (2 args, no course_id)
Acceptance Criteria
What
Two test functions in
tests/unit/progress_tests.rsreference non-existent helper functions and expect panic messages that don't match the actual contract code. These tests will not compile.Why
The tests
test_complete_module_non_existent_module_panicsandtest_submit_quiz_score_without_enrollment_panicscallsetup_tracker(&env)andcreate_test_course(&env, &client, &course_id)which don't exist. The actual functions aresetup_contract(&env)andcreate_test_course(&env, &client). Additionally, the expected panic strings don't match:"module does not belong to course"but contract panics with"module not found in course""learner is not enrolled in course"but contract panics with"not enrolled"Scope
#[should_panic(expected = "...")]attributes to match actual contract panic stringsTechnical Context
tests/unit/progress_tests.rs(lines ~673-699)progress-tracker/src/lib.rs(lines ~260, ~349)setup_contract(&env),create_test_course(&env, &client)(2 args, no course_id)Acceptance Criteria
#[should_panic(expected = "...")]matches actual contract panic stringscargo test