The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 22, 17:00 UTC
test(web): Arabic arrow-key test no longer drops its first key press (#25145)
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Theo Browne committed
Oct 25, 2026 at 16:53 UTC
1a13127c15b24132a896eb72fda060d36f705c08
1 file changed
+5
-1
apps/web/src/components/ComposerPromptEditorTiptap.input.browser.test.tsx
+5
-1
@@ -13,7 +13,7 @@ import { createElement, createRef, useEffect, useState } from "react";
13
import { describe, expect, it, vi } from "vite-plus/test";
14
import { userEvent } from "vite-plus/test/browser";
15
16
-import { act, render } from "../../test/render";
16
+import { act, fakeTimers, render } from "../../test/render";
17
18
import { serializeEditorDoc } from "~/composer-rich-text-doc";
19
import { isMacPlatform } from "~/lib/utils";
@@ -376,10 +376,14 @@ describe("composer context undo lifetime", () => {
376
377
describe("an Arabic line", () => {
378
async function focusEnd(editor: Editor) {
379
+ // ProseMirror rewrites the DOM caret 20ms after focus. Run that now, or it
380
+ // can undo the first arrow key before ProseMirror reads the native move.
381
+ using _timers = fakeTimers();
382
await act(async () => {
383
editor.commands.focus("end");
384
});
385
await vi.waitFor(() => expect(document.activeElement).toBe(editor.view.dom));
386
+ vi.runOnlyPendingTimers();
387
}
388
389
it("leaves inline code through its start with ArrowRight, which points back", async () => {