You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Summary:
Pull Request resolved: #46639
These tests were skipped when we were switching to component stacks, which also hid a bug later in the stack. Re-enable them.
Changelog: [Internal]
Reviewed By: javache
Differential Revision: D63349616
'Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.%s',
96
+
'\n\nCheck the render method of `DoesNotUseKey`.',
97
+
'',
98
+
expect.stringMatching('at DoesNotUseKey'),
99
+
]);
100
+
expect(spy).toHaveBeenCalledWith({
101
+
level: 'warn',
102
+
category: expect.stringContaining(
103
+
'Warning: Each child in a list should have a unique',
104
+
),
105
+
componentStack: expect.anything(),
106
+
componentStackType: 'stack',
107
+
message: {
108
+
content:
109
+
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.',
110
+
substitutions: [
111
+
{length: 45,offset: 62},
112
+
{length: 0,offset: 107},
113
+
],
114
+
},
115
+
});
98
116
99
117
// The Warning: prefix is added due to a hack in LogBox to prevent double logging.
// We also interpolate the string before passing to the underlying console method.
119
+
expect(mockError.mock.calls[0]).toEqual([
120
+
expect.stringMatching(
121
+
'Warning: Each child in a list should have a unique "key" prop.\n\nCheck the render method of `DoesNotUseKey`. See https://react.dev/link/warning-keys for more information.\n at ',
122
+
),
123
+
]);
101
124
});
102
125
103
126
it('integrates with React and handles a fragment warning in LogBox',()=>{
0 commit comments