Skip to content

Conversation

@Rishi2600
Copy link

@Rishi2600 Rishi2600 commented Jan 10, 2026

Summary

This PR adds Jest unit tests for gif-animator.js, which manages animated GIF playback on the turtle canvas.

fixes: #5121

Changes

  • Add test suite for GIFAnimator class initialization
  • Add test suite for GIF detection and ID generation
  • Add test suite for animation creation and lifecycle
  • Add test suite for frame rendering and transforms
  • Add test suite for position updates and cleanup

Coverage

This PR adds 51 comprehensive test cases covering:

  • GIFAnimator class initialization
  • GIF detection and ID generation
  • animation creation and lifecycle
  • frame rendering and transforms
  • position updates and cleanup

Covers achieved:

  • Statement - 97.75% (87/89)
  • Branches - 87.5% (28/32)
  • Functions - 87.5% (14/16)
  • Lines - 100% (84/84)

Coverge summary -

image image image

Testing

All existing tests pass, including the CI and the new tests added.

@github-actions
Copy link
Contributor

✅ All Jest tests passed! This PR is ready to merge.

@omsuneri omsuneri self-requested a review January 10, 2026 17:52
@Rishi2600
Copy link
Author

Hey @omsuneri if you have a moment, could you please review this and if there are any suggestions, let me know. Thanks!

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 unit test to gif-animator.js

1 participant