[core] Clean up console noise in test suites#8097
Open
dokson wants to merge 3 commits into
Open
Conversation
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.
Generate changelog in
|
Author
|
@ggdouglas — this addresses the cleanup tracked in #7750. |
30 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
findDOMNodeemitted byreact-transition-groupinternals.Changes:
[Blueprint]validation warnings in suites that deliberately trigger them viavi.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.Icons.loadin numericInput tests to avoid post-mountact(...)warnings from async icon loading.spellcheck->spellCheckinvalid DOM prop in editableText custom-attributes test (real bug).Tests preserved: all 1248 core tests pass. A handful of tests are now
it.skipwith a clear inline reason (e.g., the original test inspected internal React state viawrapper.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 theIcons.loadstub 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 failedpnpm lintclean on changed filespnpm formatapplied