Migrate Tests from Enzyme to React Testing Library (RTL)
Author: ggdouglasCreated May 5, 2025Updated Jun 17, 2026
LabelsDomain: testing
Blueprint currently relies on Enzyme for React component testing (e.g., in alertTests.tsx). Enzyme is no longer maintained and we rely on a makeshift adapter for React 18 support. We should migrate our tests to React Testing Library (RTL) or another modern alternative to ensure long-term maintainability and compatibility with future React versions. This migration will help us keep up with the React ecosystem and improve our test reliability.
See:
- https://dev.to/wojtekmaj/enzyme-is-dead-now-what-ekl
- https://github.com/cfaester/enzyme-adapter-react-18
Tasks:
- Audit all test files using Enzyme.
- Replace Enzyme usage with RTL
- Update test utilities and helpers as needed.
- Ensure all tests pass and maintain coverage.
Audit
The following tests use Enzyme:
- core/test/alert/alertTests.tsx | https://github.com/palantir/blueprint/pull/7445
- core/test/breadcrumbs/breadcrumbsTests.tsx | https://github.com/palantir/blueprint/pull/7446
- core/test/breadcrumbs/breadcrumbTests.tsx | https://github.com/palantir/blueprint/pull/7446
- core/test/buttons/abstractButtonTests.tsx | https://github.com/palantir/blueprint/pull/7447
- core/test/callout/calloutTests.tsx | https://github.com/palantir/blueprint/pull/7448
- core/test/card/cardTests.tsx | https://github.com/palantir/blueprint/pull/7449
- core/test/card-list/cardListTests.tsx | https://github.com/palantir/blueprint/pull/7449
- core/test/collapse/collapseTests.tsx | https://github.com/palantir/blueprint/pull/7437
- core/test/context-menu/contextMenuTests.tsx | https://github.com/palantir/blueprint/pull/7777
- core/test/control-card/controlCardTests.tsx | https://github.com/palantir/blueprint/pull/7453
- core/test/controls/controlsTests.tsx | https://github.com/palantir/blueprint/pull/7453
- core/test/controls/inputGroupTests.tsx | https://github.com/palantir/blueprint/pull/7455
- core/test/controls/numericInputTests.tsx | https://github.com/palantir/blueprint/pull/7778
- core/test/controls/radioGroupTests.tsx | https://github.com/palantir/blueprint/pull/7456
- core/test/dialog/dialogTests.tsx | https://github.com/palantir/blueprint/pull/7438
- core/test/drawer/drawerTests.tsx | https://github.com/palantir/blueprint/pull/7734
- core/test/editable-text/editableTextTests.tsx | https://github.com/palantir/blueprint/pull/7723
- core/test/entity-title/entityTitleTests.tsx | https://github.com/palantir/blueprint/pull/7739
- core/test/forms/asyncControllableInputTests.tsx | https://github.com/palantir/blueprint/pull/7780
- core/test/forms/fileInputTests.tsx | https://github.com/palantir/blueprint/pull/7783
- core/test/forms/formGroupTests.tsx | https://github.com/palantir/blueprint/pull/7769
- core/test/forms/textAreaTests.tsx | https://github.com/palantir/blueprint/pull/7784
- core/test/html/htmlTests.tsx | https://github.com/palantir/blueprint/pull/7785
- core/test/html-select/htmlSelectTests.tsx | https://github.com/palantir/blueprint/pull/7786
- core/test/icon/iconTests.tsx | https://github.com/palantir/blueprint/pull/7792
- core/test/menu/menuItemTests.tsx | https://github.com/palantir/blueprint/pull/7789
- core/test/menu/menuTests.tsx | https://github.com/palantir/blueprint/pull/7789
- core/test/multistep-dialog/multistepDialogTests.tsx | https://github.com/palantir/blueprint/pull/7799
- core/test/non-ideal-state/nonIdealStateTests.tsx | https://github.com/palantir/blueprint/pull/7788
- core/test/overflow-list/overflowListTests.tsx | [SKIPPED]
- core/test/overlay/overlayTests.tsx | https://github.com/palantir/blueprint/pull/7800
- core/test/overlay2/overlay2Tests.tsx | https://github.com/palantir/blueprint/pull/7636
- core/test/panel-stack/panelStackTests.tsx | https://github.com/palantir/blueprint/pull/7801
- core/test/popover/popoverTests.tsx | https://github.com/palantir/blueprint/pull/7532
- core/test/portal/portalTests.tsx | https://github.com/palantir/blueprint/pull/7802
- core/test/progress/progressBarTests.tsx | https://github.com/palantir/blueprint/pull/7787
- core/test/resize-sensor/resizeSensorTests.tsx | [SKIPPED]
- core/test/section/sectionTests.tsx | https://github.com/palantir/blueprint/pull/7791
- core/test/segmented-control/segmentedControlTests.tsx | https://github.com/palantir/blueprint/pull/7798
- core/test/slider/handleTests.tsx | https://github.com/palantir/blueprint/pull/7772
- core/test/slider/multiSliderTests.tsx | https://github.com/palantir/blueprint/pull/7772
- core/test/slider/rangeSliderTests.tsx | https://github.com/palantir/blueprint/pull/7772
- core/test/slider/sliderTests.tsx | https://github.com/palantir/blueprint/pull/7772
- core/test/slider/sliderTestUtils.ts | https://github.com/palantir/blueprint/pull/7772
- core/test/spinner/spinnerTests.tsx | https://github.com/palantir/blueprint/pull/7771
- core/test/tabs/tabsTests.tsx | https://github.com/palantir/blueprint/pull/7793
- core/test/tag/compoundTagTests.tsx | https://github.com/palantir/blueprint/pull/7795
- core/test/tag/tagTests.tsx | https://github.com/palantir/blueprint/pull/7795
- core/test/tag-input/tagInputTests.tsx | https://github.com/palantir/blueprint/pull/7779
- core/test/text/textTests.tsx | https://github.com/palantir/blueprint/pull/7794
- core/test/toast/toastTests.tsx | https://github.com/palantir/blueprint/pull/7803
- core/test/tooltip/tooltipTests.tsx | https://github.com/palantir/blueprint/pull/7669
- core/test/tree/treeTests.tsx | https://github.com/palantir/blueprint/pull/7770
- datetime/test/common/dayPickerTestUtils.ts
- datetime/test/components/dateInputTests.tsx
- datetime/test/components/datePickerTests.tsx
- datetime/test/components/dateRangeInputTests.tsx | https://github.com/palantir/blueprint/pull/7711
- datetime/test/components/dateRangePickerTests.tsx
- datetime/test/components/timePickerTests.tsx | https://github.com/palantir/blueprint/pull/7524
- datetime/test/components/timezoneSelectTests.tsx
- datetime/test/dateInputMigrationUtilsTests.tsx
- icons/test/generatedIconsTests.tsx
- icons/test/svgIconContainerTests.tsx
- select/test/itemRendererTests.tsx
- select/test/multiSelectTests.tsx
- select/test/omnibarTests.tsx
- select/test/queryListTests.tsx
- select/test/selectComponentSuite.tsx
- select/test/selectPopoverTestSuite.tsx
- select/test/selectTests.tsx
- select/test/suggestTests.tsx
- table/test/common/internal/scrollUtilsTests.tsx
- table/test/quadrants/tableQuadrantStackTests.tsx
- table/test/quadrants/tableQuadrantTests.tsx
- table/test/columnHeaderCellTests.tsx
- table/test/editableCellTests.tsx
- table/test/editableNameTests.tsx
- table/test/locatorTests.tsx
- table/test/resizableTests.tsx
- table/test/rowHeaderCellTests.tsx
- table/test/tableBodyTests.tsx
- table/test/tableTests.tsx
There are also several Table tests that leverage a custom testing harness that uses Enzyme:
(see: https://github.com/palantir/blueprint/pull/7149)
- table/test/formats/jsonFormatTests.tsx
- table/test/formats/truncatedFormatTests.tsx
- table/test/cellTests.tsx
- table/test/columnHeaderCellTests.tsx
- table/test/columnTests.tsx
- table/test/guidesTests.tsx
- table/test/harness.ts
- table/test/loadableContentTests.tsx
- table/test/loadingOptionsTests.tsx
- table/test/menusTests.tsx
- table/test/reorderableTests.tsx
- table/test/resizableTests.tsx
- table/test/rowHeaderCellTests.tsx
- table/test/selectableTests.tsx
- table/test/selectionTests.tsx
- table/test/tableTests.tsx
Source: palantir/blueprint