Skip to content

Conversation

@STRML
Copy link
Collaborator

@STRML STRML commented Dec 30, 2025

Summary

  • Replace enzyme and enzyme-adapter-react-16 with @testing-library/react for React 18 compatibility
  • Update react-test-renderer to v18
  • Add TextEncoder polyfill for Node 18+ jsdom compatibility
  • Migrate all existing tests to RTL idioms
  • Add additional test coverage (45 tests total, 98%+ coverage)

Changes

Dependencies

  • Added: @testing-library/react, @testing-library/jest-dom, @testing-library/user-event
  • Removed: enzyme, enzyme-adapter-react-16
  • Updated: react, react-dom, react-test-renderer to v18

Test Infrastructure

  • New setupTests/rtl.js with TextEncoder polyfill and jest-dom matchers
  • Updated jest.config.js to use setupFilesAfterEnv

Test Coverage

  • Axis restrictions (x, y, none)
  • Min/max constraints
  • All callbacks (onResize, onResizeStart, onResizeStop)
  • All 8 handle directions
  • Event.persist handling
  • Component unmounting
  • Edge cases (no callbacks, no children)

Test plan

  • All 45 tests pass
  • Coverage at 98%+
  • ESLint passes (1 minor warning)
  • Flow has expected test-file ref nullability errors (non-blocking)

Replace enzyme and enzyme-adapter-react-16 with @testing-library/react,
@testing-library/jest-dom, and @testing-library/user-event for React 18
compatibility.

- Update jest.config.js to use setupFilesAfterEnv with RTL setup
- Migrate all existing tests to RTL idioms (render, container queries)
- Add additional test coverage for axis restrictions, constraints,
  callbacks, handle directions, event handling, and state management
- Update react-test-renderer to v18 for snapshot compatibility

All 45 tests pass with 98%+ coverage.

Co-authored-by: Sculptor <sculptor@imbue.com>
@github-actions
Copy link

Packj audit found 1/1 risky dependencies.

Click here for details

Registry Package Version Risks
npm react-draggable 4.0.3

undesirable

. Click for details
  • package is old or abandoned: 2303 days old
  • invalid or no author email: no email
  • Triggered by workflow run 15 on commit 342d0cc4878b54285d62ae41b202054fe7b001c3

    Co-authored-by: Sculptor <sculptor@imbue.com>
    @STRML STRML force-pushed the fix/test-react18-compat branch from 7b83689 to 95d7a1d Compare December 30, 2025 22:17
    @github-actions
    Copy link

    Packj audit found 1/1 risky dependencies.

    Click here for details

    Registry Package Version Risks
    npm react-draggable 4.5.0

    undesirable

    . Click for details
  • invalid or no author email: no email
  • Triggered by workflow run 17 on commit 96842109f8999956fa3591bb366029d6ffb47b83

    @STRML STRML merged commit ada8e78 into master Dec 30, 2025
    3 checks passed
    @STRML STRML deleted the fix/test-react18-compat branch December 30, 2025 22:18
    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.

    2 participants