Repository navigation
Commit ce8856c
test(channels): run the member-search debounce on a controlled clock
The two combined invitation paging tests in ChannelMembersDialog.test.tsx
sit at the 5 s Vitest default and time out on loaded CI shards roughly
one run in five on main. Of their ~2.5 s, ~1.15 s is pure waiting on the
real 200 ms useMemberSearch debounce, paid once each for typing, relay
page 2, refresh and the query change. The rest is render work that
scales with runner speed and cannot be waited away.
pagedInvitations now fakes setTimeout/clearTimeout after setup() and
advances the debounce explicitly in idle(). user-event awaits a real
setTimeout(0) after every action, so the faked steps drive fireEvent
instead; the file's keyboard and highlight tests keep t.user. afterEach
restores real timers first, so a failed paging test cannot leak its
fake clock into the next setup().
Assertions are unchanged (30/60/90/95/96 rows, page sequences, no
publishes). Local: pages 2392 -> 1441 ms, resets 2547 -> 1304 ms; whole
file 48/48 in 27.8 s. Fail-then-pass: removing the invitation-page reset
from refreshMembers fails resets; removing the relay page-2 search.next()
fails both.
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Signed-off-by: Matt Toohey <[email protected]>1 parent f9a5e6f commit ce8856c
1 file changed
Lines changed: 39 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
| |||
49 | 56 | | |
50 | 57 | | |
51 | 58 | | |
| 59 | + | |
| 60 | + | |
52 | 61 | | |
53 | 62 | | |
54 | 63 | | |
| |||
1266 | 1275 | | |
1267 | 1276 | | |
1268 | 1277 | | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
1269 | 1281 | | |
1270 | 1282 | | |
1271 | 1283 | | |
1272 | | - | |
1273 | | - | |
1274 | | - | |
| 1284 | + | |
| 1285 | + | |
| 1286 | + | |
| 1287 | + | |
| 1288 | + | |
| 1289 | + | |
| 1290 | + | |
| 1291 | + | |
| 1292 | + | |
| 1293 | + | |
| 1294 | + | |
| 1295 | + | |
| 1296 | + | |
| 1297 | + | |
1275 | 1298 | | |
1276 | | - | |
1277 | | - | |
1278 | | - | |
| 1299 | + | |
1279 | 1300 | | |
1280 | 1301 | | |
1281 | 1302 | | |
| |||
1285 | 1306 | | |
1286 | 1307 | | |
1287 | 1308 | | |
1288 | | - | |
| 1309 | + | |
1289 | 1310 | | |
1290 | | - | |
| 1311 | + | |
1291 | 1312 | | |
1292 | 1313 | | |
1293 | 1314 | | |
1294 | 1315 | | |
1295 | 1316 | | |
1296 | 1317 | | |
1297 | | - | |
| 1318 | + | |
1298 | 1319 | | |
1299 | 1320 | | |
1300 | 1321 | | |
| |||
1308 | 1329 | | |
1309 | 1330 | | |
1310 | 1331 | | |
1311 | | - | |
1312 | | - | |
1313 | | - | |
| 1332 | + | |
| 1333 | + | |
1314 | 1334 | | |
1315 | 1335 | | |
1316 | 1336 | | |
| |||
1325 | 1345 | | |
1326 | 1346 | | |
1327 | 1347 | | |
1328 | | - | |
| 1348 | + | |
1329 | 1349 | | |
1330 | 1350 | | |
1331 | | - | |
1332 | | - | |
1333 | | - | |
| 1351 | + | |
| 1352 | + | |
1334 | 1353 | | |
1335 | 1354 | | |
1336 | | - | |
| 1355 | + | |
1337 | 1356 | | |
1338 | 1357 | | |
1339 | 1358 | | |
1340 | 1359 | | |
1341 | 1360 | | |
1342 | | - | |
| 1361 | + | |
1343 | 1362 | | |
1344 | 1363 | | |
1345 | | - | |
| 1364 | + | |
1346 | 1365 | | |
1347 | 1366 | | |
1348 | 1367 | | |
| |||
0 commit comments