Skip to content

test(progress-tracker): add batch_submit_quiz_score edge case tests (fixes #641) - #649

Closed
lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:test/issue-641-batch-submit-quiz-score-edge-cases
Closed

lmduy2612 wants to merge 1 commit into
ChainLearnOfficial:mainfrom
lmduy2612:test/issue-641-batch-submit-quiz-score-edge-cases

Conversation

@lmduy2612

Copy link
Copy Markdown

Closes #641.

Summary of Changes

Adds comprehensive edge-case test coverage for batch_submit_quiz_score in contracts/progress-tracker:

  • Batch size of 1: verifies that submitting a single score through batch behaves identically to single submit (test_batch_submit_quiz_score_batch_size_one_works_like_single).
  • Duplicate quiz IDs: verifies that duplicate quizzes within the same batch are handled idempotently; the first is recorded and the duplicate is skipped without overwriting (test_batch_submit_quiz_score_with_duplicate_quiz_ids_skips_second).
  • All entries valid: verifies complete batch submission and aggregate score calculation (test_batch_submit_quiz_score_all_entries_valid).
  • Returned Vec filtering: verifies that the returned Vec includes only successfully submitted quiz IDs and strictly excludes all skipped / invalid entries (test_batch_submit_quiz_score_returned_vec_excludes_all_skipped_quizzes).

Verification

  • cargo test --test progress_tests test_batch_submit_quiz_score: 14/14 tests pass.
  • Code style adheres strictly to project conventions.

@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 batch_submit_quiz_score edge case tests

2 participants