Skip to content

test(progress-tracker): add course archiving edge case tests - #656

Closed
lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:test/issue-637-course-archiving-edge-cases
Closed

lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:test/issue-637-course-archiving-edge-cases

Conversation

@lmduy2612

Copy link
Copy Markdown

Description

Fixes #637

Adds comprehensive unit tests covering edge cases for course archiving in the progress-tracker contract:

  1. test_archive_already_archived_course_panics: Verifies that attempting to archive an already-archived course panics with "course already archived".
  2. test_enrolling_in_archived_course_panics: Verifies that attempting to enroll in an archived course panics with "course is archived".
  3. test_completing_modules_in_archived_course_succeeds: Verifies that previously enrolled learners can still complete modules and record progress even after the course is archived.
  4. test_submitting_quiz_scores_in_archived_course_succeeds: Verifies that previously enrolled learners can still submit quiz scores in an archived course.
  5. test_archive_course_emits_course_archived_event: Verifies that archive_course publishes the expected (course_archived,) event with the course ID payload.

Testing

  • Verified with cargo test --test progress_tests archived: All 5 tests pass without regressions.
  • Code formatted with rustfmt.

@DeFiVC DeFiVC closed this Oct 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add course archiving edge case tests

2 participants