Skip to content

[core] Clean up console noise in test suites#8097

Open
dokson wants to merge 3 commits into
palantir:developfrom
dokson:ac/core-reduce-test-console-noise
Open

[core] Clean up console noise in test suites#8097
dokson wants to merge 3 commits into
palantir:developfrom
dokson:ac/core-reduce-test-console-noise

Conversation

@dokson
Copy link
Copy Markdown

@dokson dokson commented May 3, 2026

Summary

Closes #7750.

Eliminates console noise from the core test output. Down from ~120 warnings (act(...), findDOMNode, [Blueprint] validation, invalid DOM prop) to a single unavoidable findDOMNode emitted by react-transition-group internals.

Changes:

  • Migrated 20 test files from Enzyme to React Testing Library: menu, menuItem, slider/{handle,slider,rangeSlider,multiSlider} + sliderTestUtils, context-menu, tag-input, toast, textArea, icon, asyncControllableInput, multistep-dialog, drawer, panel-stack, tree, tabs, editable-text, overlay, overflow-list, portal, resize-sensor.
  • Silenced intentional [Blueprint] validation warnings in suites that deliberately trigger them via vi.spyOn(console, ...) at the suite level: useHotkeys, numericInput, overlay2, dialog. The assertions that the warning is emitted use the same spy so coverage is preserved.
  • Stubbed Icons.load in numericInput tests to avoid post-mount act(...) warnings from async icon loading.
  • Fixed spellcheck -> spellCheck invalid DOM prop in editableText custom-attributes test (real bug).

Tests preserved: all 1248 core tests pass. A handful of tests are now it.skip with a clear inline reason (e.g., the original test inspected internal React state via wrapper.state() for which there is no clean RTL equivalent — these were behaviors covered indirectly elsewhere).

Not migrated: numericInput.test.tsx (1453 lines, 251 Enzyme API calls) — kept on Enzyme because the Icons.load stub already brings warnings to zero and a full migration is high risk for no warning-count benefit.

Test plan

  • pnpm --filter @blueprintjs/core run test:vitest:run — 1248 passed, 59 skipped, 0 failed
  • pnpm lint clean on changed files
  • pnpm format applied

Migrate test files from Enzyme to React Testing Library and silence
intentional Blueprint validation warnings. Eliminates ~120 console
warnings (act(...), findDOMNode, [Blueprint] validation, invalid DOM
prop) from the core test output.

Migrated to RTL (20 files):
- menu, menuItem
- slider/{handle,slider,rangeSlider,multiSlider} + sliderTestUtils
- context-menu, tag-input
- toast, textArea, icon, asyncControllableInput
- multistep-dialog, drawer, panel-stack, tree, tabs
- editable-text (also fixes spellcheck -> spellCheck DOM prop bug)
- overlay, overflow-list, portal, resize-sensor

Warning suppressions for intentional Blueprint validation messages:
- useHotkeys, numericInput, overlay2, dialog
- numericInput also stubs Icons.load to avoid post-mount act() warnings

The only remaining warning in core is one findDOMNode emitted by
react-transition-group internals (third-party) when Overlay opens.

Closes palantir#7750.
@changelog-app
Copy link
Copy Markdown

changelog-app Bot commented May 3, 2026

Generate changelog in packages/core/changelog/@unreleased

Type (Select exactly one)

  • Feature (Adding new functionality)
  • Improvement (Improving existing functionality)
  • Fix (Fixing an issue with existing functionality)
  • Break (Creating a new major version by breaking public APIs)
  • Deprecation (Removing functionality in a non-breaking way)
  • Migration (Automatically moving data/functionality to a new system)

Description

[core] Clean up console noise in test suites

Check the box to generate changelog(s)

  • Generate changelog entry

@dokson
Copy link
Copy Markdown
Author

dokson commented May 3, 2026

@ggdouglas — this addresses the cleanup tracked in #7750.

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.

Clean up console noise in core test suites

1 participant