Skip to content

Conversation

dmytrokirpa
Copy link
Contributor

@dmytrokirpa dmytrokirpa commented Oct 12, 2025

Previous Behavior

The @fluentui/react's tests previously used react-test-renderer, which is now deprecated, making them unsuitable for React 19 integration testing.

The main test errors encountered during React 19 integration were:

  1. console.error] react-test-renderer is deprecated
  2. Error: Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops. at getRootForUpdatedFiber
  3. Can't access .root on unmounted test renderer

New Behavior

  • This PR updates all tests from react-test-renderer to @testing-library/react, addressing the first and third issues.
  • Resolves an infinite loop in the ColorPicker component's componentDidUpdate.
  • Enables RIT (react-integration-tester) on CI to run React 17 and 19 integration tests for the @fluentui/react package.

Related Issue(s)

@dmytrokirpa dmytrokirpa self-assigned this Oct 12, 2025
@dmytrokirpa dmytrokirpa added Area: Testing Fluent UI react (v8) Issues about @fluentui/react (v8) React 19 labels Oct 12, 2025
Copy link

github-actions bot commented Oct 12, 2025

📊 Bundle size report

Package & Exports Baseline (minified/GZIP) PR Change
react
ColorPicker
134.934 kB
42.12 kB
134.97 kB
42.125 kB
36 B
5 B
react
Fluent UI React (entire library)
1.019 MB
283.171 kB
1.019 MB
283.18 kB
36 B
9 B
react-charts
AreaChart
385.201 kB
117.431 kB
385.193 kB
117.43 kB
-8 B
-1 B
react-charts
DeclarativeChart
691.585 kB
198.496 kB
691.577 kB
198.496 kB
-8 B
react-charts
DonutChart
296.928 kB
88.686 kB
296.92 kB
88.685 kB
-8 B
-1 B
react-charts
FunnelChart
288.084 kB
85.615 kB
288.076 kB
85.614 kB
-8 B
-1 B
react-charts
GanttChart
368.624 kB
111.034 kB
368.616 kB
111.034 kB
-8 B
react-charts
GaugeChart
311.63 kB
92.299 kB
311.622 kB
92.296 kB
-8 B
-3 B
react-charts
GroupedVerticalBarChart
376.709 kB
113.571 kB
376.701 kB
113.57 kB
-8 B
-1 B
react-charts
HeatMapChart
370.652 kB
112.597 kB
370.644 kB
112.595 kB
-8 B
-2 B
react-charts
HorizontalBarChart
296.255 kB
87.223 kB
296.247 kB
87.222 kB
-8 B
-1 B
react-charts
Legends
235.243 kB
69.602 kB
235.235 kB
69.601 kB
-8 B
-1 B
react-charts
LineChart
396.395 kB
119.501 kB
396.387 kB
119.5 kB
-8 B
-1 B
react-charts
ScatterChart
376.226 kB
113.519 kB
376.218 kB
113.518 kB
-8 B
-1 B
react-charts
VerticalBarChart
411.223 kB
119.119 kB
411.215 kB
119.118 kB
-8 B
-1 B
react-charts
VerticalStackedBarChart
383.039 kB
114.949 kB
383.031 kB
114.948 kB
-8 B
-1 B
Unchanged fixtures
Package & Exports Size (minified/GZIP)
global-context
createContext
510 B
328 B
global-context
createContextSelector
537 B
339 B
keyboard-key
keyboard-key package
3.746 kB
1.928 kB
keyboard-keys
Multiple keyCodes
50 B
70 B
keyboard-keys
Multiple keys
87 B
94 B
keyboard-keys
Single key
44 B
64 B
keyboard-keys
Single keyCode
39 B
59 B
priority-overflow
createOverflowManager
4.519 kB
1.881 kB
react
ActivityItem
71.22 kB
23.347 kB
react
Announced
38.472 kB
13.275 kB
react
Autofill
15.42 kB
4.766 kB
react
Breadcrumb
200.805 kB
59.601 kB
react
Button
194.354 kB
55.886 kB
react
ButtonGrid
179.242 kB
53.891 kB
react
Calendar
121.162 kB
36.83 kB
react
Callout
84.299 kB
27.593 kB
react
Check
53.206 kB
17.835 kB
react
Checkbox
59.978 kB
19.874 kB
react
ChoiceGroup
65.488 kB
21.465 kB
react
ChoiceGroupOption
58.769 kB
19.353 kB
react
Coachmark
92.7 kB
29.305 kB
react
Color
7.789 kB
3.127 kB
react
ComboBox
250.687 kB
71.515 kB
react
CommandBar
201.861 kB
59.387 kB
react
ContextualMenu
154.229 kB
47.566 kB
react
DatePicker
183.251 kB
55.892 kB
react
DateTimeUtilities
5.244 kB
1.849 kB
react
DetailsList
229.929 kB
65.81 kB
react
Dialog
210.16 kB
62.358 kB
react
Divider
19.588 kB
6.84 kB
react
DocumentCard
215.843 kB
63.666 kB
react
DragDrop
8.343 kB
2.724 kB
react
DraggableZone
34.28 kB
11.488 kB
react
Dropdown
233.151 kB
67.962 kB
react
ExtendedPicker
96.823 kB
27.866 kB
react
Fabric
41.728 kB
14.343 kB
react
Facepile
209.377 kB
62.375 kB
react
FloatingPicker
240.865 kB
68.222 kB
react
FocusTrapZone
16.99 kB
5.891 kB
react
FocusZone
55.1 kB
17.451 kB
react
Grid
179.242 kB
53.891 kB
react
GroupedList
135.035 kB
40.67 kB
react
GroupedListV2
122.659 kB
37.758 kB
react
HoverCard
96.784 kB
30.688 kB
react
Icon
51.887 kB
17.263 kB
react
Icons
66.339 kB
24.385 kB
react
Image
46.901 kB
15.695 kB
react
Keytip
81.301 kB
26.677 kB
react
KeytipData
14.05 kB
4.583 kB
react
KeytipLayer
103.089 kB
31.9 kB
react
Keytips
105.873 kB
32.904 kB
react
Label
38.324 kB
13.241 kB
react
Layer
48.089 kB
16.348 kB
react
Link
39.665 kB
13.653 kB
react
List
39.346 kB
12.454 kB
react
MarqueeSelection
74.49 kB
22.402 kB
react
MessageBar
189.388 kB
56.33 kB
react
Modal
93.738 kB
30.223 kB
react
Nav
186.825 kB
55.723 kB
react
OverflowSet
33.354 kB
11.282 kB
react
Overlay
40.885 kB
14.077 kB
react
Panel
200.327 kB
59.336 kB
react
Persona
114.591 kB
36.435 kB
react
PersonaCoin
114.591 kB
36.435 kB
react
PersonaPresence
58.076 kB
19.372 kB
react
Pickers
297.91 kB
82.996 kB
react
Pivot
187.734 kB
56.5 kB
react
Popup
12.312 kB
4.197 kB
react
Positioning
22.764 kB
7.683 kB
react
PositioningContainer
73.445 kB
23.685 kB
react
ProgressIndicator
39.477 kB
13.528 kB
react
Rating
82.086 kB
26.09 kB
react
ResizeGroup
13.35 kB
4.379 kB
react
ResponsiveMode
8.13 kB
2.966 kB
react
ScrollablePane
55.541 kB
17.718 kB
react
SearchBox
187.63 kB
55.936 kB
react
SelectableOption
724 B
413 B
react
SelectedItemsList
231.35 kB
67.176 kB
react
Selection
42.418 kB
12.26 kB
react
Separator
35.365 kB
12.132 kB
react
Shimmer
49.249 kB
16.258 kB
react
ShimmeredDetailsList
240.71 kB
68.549 kB
react
Slider
57.627 kB
19.198 kB
react
SpinButton
191.297 kB
57.006 kB
react
Spinner
41.759 kB
14.468 kB
react
Stack
42.03 kB
14.386 kB
react
Sticky
32.577 kB
10.488 kB
react
Styling
46.033 kB
15.135 kB
react
SwatchColorPicker
189.637 kB
57.417 kB
react
TeachingBubble
204.639 kB
60.311 kB
react
Text
36.886 kB
12.806 kB
react
TextField
80.798 kB
25.308 kB
react
Theme
43.486 kB
14.168 kB
react
ThemeGenerator
12.384 kB
4.116 kB
react
TimePicker
240.515 kB
69.311 kB
react
Toggle
46.201 kB
15.957 kB
react
Tooltip
87.073 kB
28.151 kB
react
Utilities
82.938 kB
25.15 kB
react
Viewport
23.872 kB
7.642 kB
react
WeeklyDayPicker
101.348 kB
31.644 kB
react
WindowProvider
1.059 kB
541 B
react-accordion
Accordion (including children components)
108.256 kB
33.14 kB
react-aria
ARIA - Default
237 B
181 B
react-avatar
Avatar
48.555 kB
15.528 kB
react-avatar
AvatarGroup
19.235 kB
7.617 kB
react-avatar
AvatarGroupItem
62.699 kB
19.747 kB
react-badge
Badge
25.089 kB
8.256 kB
react-badge
CounterBadge
25.869 kB
8.53 kB
react-badge
PresenceBadge
24.97 kB
9.163 kB
react-breadcrumb
@fluentui/react-breadcrumb - package
114.255 kB
31.55 kB
react-button
Button
36.705 kB
10.508 kB
react-button
CompoundButton
43.117 kB
11.812 kB
react-button
MenuButton
41.642 kB
11.917 kB
react-button
SplitButton
49.702 kB
13.496 kB
react-button
ToggleButton
52.636 kB
12.285 kB
react-calendar-compat
Calendar Compat
149.83 kB
39.965 kB
react-card
Card - All
106.044 kB
29.799 kB
react-card
Card
98.69 kB
27.924 kB
react-card
CardFooter
13.662 kB
5.517 kB
react-card
CardHeader
16.195 kB
6.38 kB
react-card
CardPreview
13.729 kB
5.645 kB
react-charting
AreaChart
284.398 kB
87.93 kB
react-charting
ChartHoverCard
37.196 kB
12.7 kB
react-charting
DeclarativeChart
617.757 kB
172.945 kB
react-charting
DonutChart
190.773 kB
59.678 kB
react-charting
GanttChart
263.791 kB
81.764 kB
react-charting
GaugeChart
191.292 kB
59.235 kB
react-charting
GroupedVerticalBarChart
275.518 kB
84.771 kB
react-charting
HeatMapChart
266.752 kB
82.478 kB
react-charting
HorizontalBarChart
127.238 kB
39.931 kB
react-charting
HorizontalBarChartWithAxis
273.507 kB
83.72 kB
react-charting
Legends
151.066 kB
46.245 kB
react-charting
LineChart
313.928 kB
94.898 kB
react-charting
MultiStackedBarChart
181.242 kB
55.075 kB
react-charting
PieChart
134.239 kB
42.282 kB
react-charting
SankeyChart
146.055 kB
45.456 kB
react-charting
ScatterChart
270.143 kB
84.068 kB
react-charting
Sparkline
87.616 kB
29.671 kB
react-charting
StackedBarChart
174.923 kB
52.655 kB
react-charting
TreeChart
84.809 kB
26.636 kB
react-charting
VerticalBarChart
285.927 kB
86.249 kB
react-charting
VerticalStackedBarChart
281.797 kB
85.737 kB
react-charts
HorizontalBarChartWithAxis
63 B
83 B
react-charts
SankeyChart
198.989 kB
61.126 kB
react-charts
Sparkline
91.123 kB
28.692 kB
react-checkbox
Checkbox
34.37 kB
11.792 kB
react-color-picker
ColorArea
49.32 kB
17.32 kB
react-color-picker
ColorPicker
17.95 kB
7.143 kB
react-color-picker
ColorSlider
41.493 kB
15.375 kB
react-combobox
Combobox (including child components)
106.981 kB
34.816 kB
react-combobox
Dropdown (including child components)
107.611 kB
34.737 kB
react-components
react-components: Button, FluentProvider & webLightTheme
68.796 kB
19.903 kB
react-components
react-components: Accordion, Button, FluentProvider, Image, Menu, Popover
236.662 kB
68.579 kB
react-components
react-components: FluentProvider & webLightTheme
43.63 kB
14.257 kB
react-components
react-components: entire library
1.278 MB
321.132 kB
react-datepicker-compat
DatePicker Compat
226.703 kB
64.124 kB
react-dialog
Dialog (including children components)
103.613 kB
30.917 kB
react-divider
Divider
20.626 kB
7.654 kB
react-field
Field
22.697 kB
8.603 kB
react-image
Image
14.473 kB
5.919 kB
react-input
Input
27.148 kB
9.108 kB
react-jsx-runtime
Classic Pragma
1.101 kB
550 B
react-jsx-runtime
JSX Dev Runtime
2.8 kB
1.251 kB
react-jsx-runtime
JSX Runtime
3.422 kB
1.493 kB
react-label
Label
13.799 kB
5.644 kB
react-link
Link
16.746 kB
6.785 kB
react-list
List
88.922 kB
26.387 kB
react-list
ListItem
112.46 kB
33.243 kB
react-menu
Menu (including children components)
165.402 kB
50.102 kB
react-menu
Menu (including selectable components)
168.384 kB
50.68 kB
react-message-bar
MessageBar (all components)
24.157 kB
8.983 kB
react-motion
@fluentui/react-motion - createMotionComponent()
4.109 kB
1.806 kB
react-motion
@fluentui/react-motion - createPresenceComponent()
5.771 kB
2.396 kB
react-motion
@fluentui/react-motion - PresenceGroup
1.727 kB
823 B
react-overflow
hooks only
12.931 kB
4.85 kB
react-persona
Persona
55.446 kB
17.41 kB
react-popover
Popover
132.3 kB
41.178 kB
react-portal
Portal
15.411 kB
5.385 kB
react-portal-compat
PortalCompatProvider
8.386 kB
2.624 kB
react-positioning
usePositioning
28.865 kB
10.146 kB
react-positioning
useSafeZoneArea
12.29 kB
4.967 kB
react-progress
ProgressBar
16.593 kB
6.613 kB
react-provider
FluentProvider
23.806 kB
8.557 kB
react-radio
Radio
31.8 kB
10.006 kB
react-radio
RadioGroup
14.889 kB
6.09 kB
react-select
Select
26.987 kB
9.848 kB
react-slider
Slider
37.211 kB
12.461 kB
react-spinbutton
SpinButton
34.468 kB
11.453 kB
react-spinner
Spinner
24.396 kB
8.201 kB
react-swatch-picker
@fluentui/react-swatch-picker - package
106.082 kB
30.558 kB
react-switch
Switch
34.55 kB
11.013 kB
react-table
DataGrid
161.157 kB
45.558 kB
react-table
Table (Primitives only)
41.975 kB
13.575 kB
react-table
Table as DataGrid
131.48 kB
36.345 kB
react-table
Table (Selection only)
69.843 kB
19.71 kB
react-table
Table (Sort only)
68.486 kB
19.324 kB
react-tag-picker
@fluentui/react-tag-picker - package
188.376 kB
56.482 kB
react-tags
InteractionTag
14.561 kB
5.865 kB
react-tags
Tag
30.413 kB
9.802 kB
react-tags
TagGroup
83.125 kB
24.561 kB
react-teaching-popover
TeachingPopover
102.777 kB
30.738 kB
react-text
Text - Default
16.19 kB
6.366 kB
react-text
Text - Wrappers
19.35 kB
6.695 kB
react-textarea
Textarea
25.53 kB
9.361 kB
react-theme
Single theme token import
69 B
89 B
react-theme
Teams: all themes
36.081 kB
7.658 kB
react-theme
Teams: Light theme
20.025 kB
5.723 kB
react-timepicker-compat
TimePicker
109.972 kB
36.348 kB
react-toast
Toast (including Toaster)
103.349 kB
30.964 kB
react-tooltip
Tooltip
57.962 kB
20.099 kB
react-tree
FlatTree
149.042 kB
42.637 kB
react-tree
PersonaFlatTree
149.798 kB
42.771 kB
react-tree
PersonaTree
146.063 kB
41.633 kB
react-tree
Tree
145.313 kB
41.507 kB
react-utilities
SSRProvider
180 B
160 B
🤖 This report was generated against 04ef18c16b70d507596609ac19d45be5a127efe4

Copy link

Pull request demo site: URL

@dmytrokirpa dmytrokirpa force-pushed the chore/migrate-react-v8-to-rtl branch from 0763312 to 3731080 Compare October 15, 2025 15:45
@github-actions github-actions bot removed the NX: core label Oct 15, 2025
@dmytrokirpa dmytrokirpa force-pushed the chore/migrate-react-v8-to-rtl branch from 3731080 to 9e1ff67 Compare October 15, 2025 15:47
@dmytrokirpa dmytrokirpa changed the title chore: migrate tests from react-test-renderer to @testing/library-react fix: migrate tests from react-test-renderer to @testing-library/react and resolve React 19 issues Oct 15, 2025
@dmytrokirpa dmytrokirpa changed the title fix: migrate tests from react-test-renderer to @testing-library/react and resolve React 19 issues fix(react): migrate tests from react-test-renderer to @testing-library/react and resolve React 19 issues Oct 15, 2025
// if props changed (as opposed to a state update), set the value
// TODO: switch to strict controlled pattern instead
if (prevProps !== this.props && this.props.value !== undefined) {
if (prevProps.value !== this.props.value && this.props.value !== undefined) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix inifite loop in React 19

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great fix ! this most probably aslo affected users runtime with R17,18

const { container, getByLabelText } = render(<DatePickerBase />);
const input = container.querySelectorAll('div')[5];

it('renders Calendar with provided props and custom formatter', () => {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved to a separate file DatePicker.CalendarMock.test.tsx to be able to mock the Calendar component to verify its props with RTL

public componentDidUpdate(prevProps: Readonly<IColorPickerProps>, prevState: Readonly<IColorPickerState>): void {
// if props changed (as opposed to a state update), update the color
if (prevProps !== this.props) {
if (prevProps.color !== this.props.color) {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fix infinite loop in React 19

@dmytrokirpa dmytrokirpa force-pushed the chore/migrate-react-v8-to-rtl branch from 9e1ff67 to 5b58fb0 Compare October 15, 2025 15:54
"@fluentui/example-data": "*",
"@fluentui/jest-serializer-merge-styles": "*",
"@fluentui/react-conformance": "*",
"@fluentui/test-utilities": "*",
Copy link
Contributor Author

@dmytrokirpa dmytrokirpa Oct 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the package is not used anymore

@dmytrokirpa dmytrokirpa requested a review from Hotell October 15, 2025 16:18
@dmytrokirpa dmytrokirpa marked this pull request as ready for review October 15, 2025 17:17
Copy link
Contributor

@Hotell Hotell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

// if props changed (as opposed to a state update), set the value
// TODO: switch to strict controlled pattern instead
if (prevProps !== this.props && this.props.value !== undefined) {
if (prevProps.value !== this.props.value && this.props.value !== undefined) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is great fix ! this most probably aslo affected users runtime with R17,18

Updated the type from 'none' to 'patch' to reflect the nature of the changes.
input.props.onClick();
});
// open the datepicker then dismiss
await userEvent.click(input);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like hallucination. the version of user-event we use has not async methods.

Copy link
Contributor Author

@dmytrokirpa dmytrokirpa Oct 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a few tests 458045f#diff-a7e2503f10a441adc194a14a0d703cca90431d7f8ad97951622408f0ce7cb0a2L217 had { delay: 100 } which made the userEvent.type async. So we need to use awaits for those, or remove the delay

I removed delay and awaits in 458045f

@Hotell Hotell merged commit 40aff10 into microsoft:master Oct 16, 2025
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants