Commit 91c1602
fix: stabilize all test suites after v14 breaking changes (#3039)
## Summary
- Fix all 67 failing test suites (506 tests) caused by v14 breaking
changes
- Resolve circular dependency chains in MessageComposer barrel imports
- Add missing React imports
- Add JSDoc warning to useDebouncedTypingActive about user?.id
requirement
- Upgrade EventEmitterMock and MediaRecorderMock to support realistic
event dispatch
- Migrate all Preview, List, Avatar prop usages in tests to
WithComponents overrides
## Test plan
- [x] yarn jest -- 142/142 suites pass, 1977/1977 tests green, 0 skipped
- [x] yarn lint-fix passes
- [ ] yarn types
- [ ] yarn build
### Categories of test fixes
| Category | Suites | Changes |
|---|---|---|
| Missing DialogManager context | ~10 | Added Chat or
DialogManagerProvider wrappers |
| Avatar prop renames | ~15 | image to imageUrl, name to userName, added
size |
| Component renames | ~10 | ReactionsList to MessageReactions,
MessageDeleted to MessageDeletedBubble, etc |
| Removed context fields | ~8 | Removed editing, updated handleDelete
signature, cooldown API migration |
| Stale snapshots | ~25 | Regenerated snap files, replaced inline
snapshots with structural assertions |
| Missing mocks | ~10 | Added useChatViewContext, useThreadContext,
deleteDraft mocks |
| Behavioral changes | ~5 | Mobile nav viewport check, action renames,
mention UI changes |
| AudioRecorder integration | 2 | Rewrote upload/submit tests to use UI
interactions |
| WithComponents migration | ~2 | Replaced Preview, List, Avatar,
LoadingErrorIndicator props with WithComponents overrides |
### Production code changes
| File | Change |
|---|---|
| Dialog/Alert.tsx, MessageComposer/QuotedMessageIndicator.tsx | Added
missing import React |
| ~14 files across MediaRecorder, TextareaComposer, Poll, Location |
Barrel to direct imports to break circular deps |
| TypingIndicator/hooks/useDebouncedTypingActive.ts | Added JSDoc
warning about user?.id requirement |
### Mock infrastructure improvements
| File | Change |
|---|---|
| mock-builders/browser/EventEmitter.js | Now stores listeners and
supports emit() for realistic event dispatch |
| mock-builders/browser/MediaRecorder.js | Tracks state transitions;
autoEmitDataOnStop static flag simulates browser stop to dataavailable
flow |
### Known follow-up
- Circular dependency root cause: Children of MessageComposer call
useMessageComposerController() instead of reading the controller from
context
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 48d4647 commit 91c1602
File tree
101 files changed
+4238
-4396
lines changed- src
- components
- Attachment/__tests__
- __snapshots__
- AudioPlayback/__tests__
- Avatar/__tests__
- BaseImage/__tests__
- ChannelHeader/__tests__
- ChannelListItem
- __tests__
- __snapshots__
- hooks/__tests__
- ChannelList/__tests__
- __snapshots__
- Channel/__tests__
- Chat/__tests__
- DateSeparator/__tests__
- Dialog/components
- EventComponent/__tests__
- Gallery/__tests__
- __snapshots__
- LoadMore/__tests__
- Loading/__tests__
- __snapshots__
- Location
- __tests__
- MediaRecorder
- AudioRecorder
- __tests__
- __snapshots__
- classes/__tests__
- hooks
- MessageActions
- __tests__
- MessageComposer
- __tests__
- __snapshots__
- hooks/__tests__
- MessageList/__tests__
- __snapshots__
- Message
- __tests__
- __snapshots__
- hooks/__tests__
- Modal/__tests__
- Poll
- PollCreationDialog
- __tests__
- ReactFileUtilities
- Reactions/__tests__
- Search/__tests__
- TextareaComposer
- SuggestionList
- __tests__
- hooks
- Threads/ThreadList/__tests__
- Thread/__tests__
- TypingIndicator
- __tests__
- hooks
- i18n/__tests__
- mock-builders/browser
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
101 files changed
+4238
-4396
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
36 | 37 | | |
37 | 38 | | |
38 | 39 | | |
| |||
62 | 63 | | |
63 | 64 | | |
64 | 65 | | |
65 | | - | |
66 | 66 | | |
| 67 | + | |
67 | 68 | | |
68 | 69 | | |
| 70 | + | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
142 | 144 | | |
143 | 145 | | |
144 | 146 | | |
145 | | - | |
| 147 | + | |
146 | 148 | | |
147 | 149 | | |
148 | 150 | | |
149 | 151 | | |
150 | | - | |
151 | | - | |
152 | | - | |
153 | | - | |
154 | 152 | | |
155 | 153 | | |
156 | 154 | | |
| |||
165 | 163 | | |
166 | 164 | | |
167 | 165 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
174 | 171 | | |
175 | 172 | | |
176 | 173 | | |
177 | 174 | | |
178 | 175 | | |
179 | 176 | | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
180 | 184 | | |
181 | 185 | | |
182 | 186 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
| 7 | + | |
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
183 | 186 | | |
184 | 187 | | |
185 | 188 | | |
186 | | - | |
| 189 | + | |
187 | 190 | | |
188 | 191 | | |
189 | 192 | | |
190 | 193 | | |
191 | 194 | | |
192 | | - | |
193 | | - | |
194 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
195 | 200 | | |
196 | 201 | | |
197 | 202 | | |
198 | | - | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
199 | 208 | | |
200 | | - | |
| 209 | + | |
201 | 210 | | |
202 | 211 | | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
203 | 216 | | |
204 | 217 | | |
205 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | | - | |
| 7 | + | |
12 | 8 | | |
13 | 9 | | |
14 | 10 | | |
| |||
17 | 13 | | |
18 | 14 | | |
19 | 15 | | |
20 | | - | |
21 | 16 | | |
22 | 17 | | |
23 | 18 | | |
| |||
286 | 281 | | |
287 | 282 | | |
288 | 283 | | |
289 | | - | |
290 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
291 | 288 | | |
292 | | - | |
293 | | - | |
| 289 | + | |
294 | 290 | | |
295 | 291 | | |
296 | 292 | | |
297 | 293 | | |
298 | 294 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
392 | | - | |
393 | | - | |
| 295 | + | |
394 | 296 | | |
395 | | - | |
396 | 297 | | |
397 | 298 | | |
0 commit comments