Diem Nguyen
12dbb114aa
test(desktop): fix flaky forum empty-draft replacement e2e ( #7981 )
...
## Summary
The `replacement=` cases (`add` and `publish`) of `forum source visit …:
A→B→A retains source draft` in `forum-agent-invitation.spec.ts` are
flaky. They fail at line 449 because the source draft still reads
`@RemoteScout hello`.
Cause: Playwright's `fill("")` on a contenteditable sets a DOM selection
and then presses `Delete`. ProseMirror handles `Delete` with its own
selection, which sometimes hasn't synced from the DOM yet. When that
happens the key press does nothing, `onUpdate` never fires, and the
clear is never recorded. I confirmed this with temporary logging:
failing runs have no authored-content update after the fill. Non-empty
`fill` uses `insertText`, which goes through ProseMirror's DOM input
path, so it isn't affected.
Fix (test only):
- Clear the draft with `ControlOrMeta+a` followed by `Delete`, so
ProseMirror owns the selection.
- Assert the replacement text before navigating away.
### Related issue
None found. The spec hasn't changed since #7125 . This test failed in 10
of the last 40 CI runs of `Desktop Smoke E2E (2)`, for example #3700 .
### Testing
- `--repeat-each=100 --retries=0 --workers=4` on the two affected cases:
- Before the fix: 14 of 200 runs failed at `:449`.
- After the fix: 200 of 200 passed.
- Full `forum-agent-invitation.spec.ts`: 19 passed.
- Pre-push hooks passed (desktop typecheck and desktop tests).
Signed-off-by: Fizz <6be7be23ec5bba868f3e1db5ec86013d76bd1a293dce5b435a192158fec13641@buzz.block.builderlab.xyz >
Co-authored-by: Fizz <6be7be23ec5bba868f3e1db5ec86013d76bd1a293dce5b435a192158fec13641@buzz.block.builderlab.xyz >
2026-09-29 15:59:30 -07:00
..
2026-07-22 13:24:46 -07:00
2026-07-30 11:25:08 -07:00
2026-08-13 14:49:40 -07:00
2026-09-09 14:07:24 -04:00
2026-07-03 15:40:29 +00:00
2026-07-30 12:34:35 -07:00
2026-09-09 14:08:01 -04:00
2026-09-09 10:32:26 -04:00
2026-09-02 21:53:15 -04:00
2026-09-22 18:31:44 +00:00
2026-09-02 21:53:15 -04:00
2026-07-24 01:23:31 +01:00
2026-08-03 18:09:24 -04:00
2026-07-24 01:23:31 +01:00
2026-08-07 16:25:49 -07:00
2026-07-28 15:01:03 -04:00
2026-07-22 13:24:46 -07:00
2026-09-24 11:33:24 -04:00
2026-09-15 05:58:16 -04:00
2026-08-19 14:32:17 -07:00
2026-08-27 20:22:28 -04:00
2026-09-22 18:31:44 +00:00
2026-09-03 23:52:55 -04:00
2026-07-14 11:11:02 -07:00
2026-08-21 17:21:36 -07:00
2026-09-23 01:07:00 +00:00
2026-07-16 18:01:53 +00:00
2026-08-26 12:09:06 -07:00
2026-07-27 15:47:04 -07:00
2026-08-12 08:25:04 -07:00
2026-09-22 18:31:44 +00:00
2026-08-24 10:11:07 -04:00
2026-09-23 01:07:00 +00:00
2026-08-31 17:29:31 -04:00
2026-09-28 12:48:16 -06:00
2026-07-04 11:51:58 -04:00
2026-09-23 11:03:54 -04:00
2026-09-04 13:36:17 -07:00
2026-08-18 12:55:00 -07:00
2026-08-25 19:09:55 -04:00
2026-08-07 10:56:08 -07:00
2026-08-24 09:39:55 -06:00
2026-08-25 19:09:55 -04:00
2026-08-14 16:29:50 +01:00
2026-07-11 13:40:16 -04:00
2026-07-14 11:11:02 -07:00
2026-08-26 10:32:46 -07:00
2026-08-07 09:21:29 -07:00
2026-08-21 09:17:04 -06:00
2026-08-13 14:49:40 -07:00
2026-07-14 16:50:22 +01:00
2026-07-19 19:01:38 +00:00
2026-08-14 16:25:40 +01:00
2026-07-28 19:37:12 +01:00
2026-07-27 16:45:34 -04:00
2026-08-03 12:08:29 -04:00
2026-09-24 11:33:24 -04:00
2026-08-21 18:20:19 -06:00
2026-09-22 18:31:44 +00:00
2026-09-02 16:20:49 -04:00
2026-09-25 22:52:02 +00:00
2026-08-13 14:49:40 -07:00
2026-09-29 15:59:30 -07:00
2026-09-23 17:12:02 -04:00
2026-07-27 11:01:42 -07:00
2026-09-15 05:58:16 -04:00
2026-07-20 00:53:53 +02:00
2026-09-09 14:08:01 -04:00
2026-08-24 16:13:03 -04:00
2026-09-11 06:08:44 -10:00
2026-07-06 06:55:58 -07:00
2026-07-20 08:58:48 -07:00
2026-09-09 10:32:26 -04:00
2026-09-15 05:58:16 -04:00
2026-09-15 05:58:16 -04:00
2026-08-25 11:34:16 -07:00
2026-08-14 17:16:28 +01:00
2026-09-22 18:31:44 +00:00
2026-09-23 01:07:00 +00:00
2026-08-21 17:21:36 -07:00
2026-09-10 10:00:15 -07:00
2026-08-07 16:25:49 -07:00
2026-08-20 15:20:24 -04:00
2026-08-04 10:39:09 -07:00
2026-08-04 10:39:09 -07:00
2026-09-15 05:58:16 -04:00
2026-09-22 18:31:44 +00:00
2026-07-06 17:41:56 -04:00
2026-07-08 14:38:52 -07:00
2026-09-03 16:07:14 +00:00
2026-09-04 13:36:17 -07:00
2026-09-09 14:07:24 -04:00
2026-09-02 21:51:45 -04:00
2026-09-11 06:08:44 -10:00
2026-08-03 14:12:21 -07:00
2026-09-10 10:00:15 -07:00
2026-08-26 10:32:46 -07:00
2026-09-03 23:52:55 -04:00
2026-09-22 18:31:44 +00:00
2026-08-18 15:24:09 -07:00
2026-09-23 01:07:00 +00:00
2026-09-22 15:55:55 -07:00
2026-08-06 08:21:35 -07:00
2026-07-16 12:44:14 -07:00
2026-08-19 14:20:58 -04:00
2026-07-24 12:10:09 -04:00
2026-09-15 10:30:05 -04:00
2026-09-15 05:58:16 -04:00
2026-09-15 10:30:05 -04:00
2026-09-15 10:30:05 -04:00
2026-09-15 05:58:16 -04:00
2026-08-03 21:51:17 -04:00
2026-09-02 16:18:54 -04:00
2026-07-04 11:51:58 -04:00
2026-09-25 23:19:32 +00:00
2026-08-07 16:25:49 -07:00
2026-08-07 16:25:49 -07:00
2026-07-28 15:01:03 -04:00
2026-07-03 15:40:29 +00:00
2026-07-30 11:15:39 -07:00
2026-09-22 18:31:44 +00:00
2026-07-12 18:46:02 -04:00
2026-09-09 14:08:01 -04:00
2026-08-27 22:36:26 -04:00
2026-08-26 20:59:47 -04:00
2026-08-26 12:09:06 -07:00
2026-08-28 10:52:03 -07:00
2026-08-20 07:42:02 -07:00
2026-09-11 06:08:44 -10:00
2026-09-11 06:08:44 -10:00
2026-08-26 12:09:06 -07:00
2026-09-09 14:08:01 -04:00
2026-08-03 14:09:46 -07:00
2026-08-24 16:28:51 -07:00
2026-07-02 19:30:24 +00:00
2026-08-24 10:11:07 -04:00
2026-07-30 11:25:08 -07:00
2026-08-13 14:49:40 -07:00
2026-07-15 07:34:50 -07:00
2026-07-27 16:45:34 -04:00
2026-09-04 16:35:35 +00:00
2026-09-28 14:44:16 -06:00
2026-07-06 13:58:15 -04:00
2026-08-11 11:11:57 -07:00
2026-09-01 16:07:35 -07:00
2026-08-14 16:25:40 +01:00
2026-08-18 12:54:40 -07:00
2026-07-29 15:48:06 -04:00
2026-09-28 18:23:42 -04:00
2026-08-21 05:45:55 -07:00
2026-07-30 20:58:03 -04:00
2026-07-30 15:47:35 -07:00
2026-09-11 20:38:41 +00:00
2026-08-25 19:09:55 -04:00
2026-08-11 19:47:19 -04:00
2026-08-28 14:51:25 -04:00
2026-08-28 14:51:25 -04:00
2026-07-15 18:39:39 -04:00
2026-07-28 15:01:03 -04:00
2026-08-26 12:09:06 -07:00
2026-08-06 15:04:39 +00:00
2026-08-26 20:57:19 +00:00
2026-08-24 16:13:03 -04:00
2026-09-22 18:31:44 +00:00
2026-08-05 15:40:40 -07:00
2026-07-25 16:49:56 -07:00
2026-08-26 20:56:21 +00:00
2026-08-21 17:21:36 -07:00
2026-07-18 00:01:24 +00:00
2026-08-04 15:39:45 +00:00
2026-09-28 19:46:14 +00:00
2026-08-19 12:50:00 +01:00
2026-09-23 01:07:00 +00:00
2026-07-31 11:15:09 -04:00
2026-07-08 14:38:52 -07:00
2026-08-31 12:14:35 +10:00
2026-08-07 16:25:49 -07:00
2026-09-09 14:07:24 -04:00
2026-08-21 16:53:50 -07:00
2026-08-21 16:53:50 -07:00
2026-09-21 08:37:14 -06:00