You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maka.apache.org by as...@apache.org on 2026/08/30 07:20:02 UTC

(maka) branch main updated: test(desktop): stop the picker spec racing two upstream guards (#4225)

This is an automated email from the ASF dual-hosted git repository.

Astro-Han pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/maka.git


The following commit(s) were added to refs/heads/main by this push:
     new 80ffda4142 test(desktop): stop the picker spec racing two upstream guards (#4225)
80ffda4142 is described below

commit 80ffda4142a10598c491dd280ef64db133f2ae00
Author: NekoPunch <95...@users.noreply.github.com>
AuthorDate: Sun Aug 30 00:19:57 2026 -0700

    test(desktop): stop the picker spec racing two upstream guards (#4225)
    
    * test(desktop): wait for the picker menu to open
    
    Reopening the picker right after choosing an item raced DropdownMenu's 50ms
    light-dismiss guard, which every hide arms, so the click was dropped and the
    spec failed on whichever machine ran the assertions between them fast enough.
    
    Generated-by: Claude Code
    
    * test(desktop): type the draft at a human rate
    
    ChatComposerInput absorbs one echo of its own onChange, so two keystrokes
    inside one frame make it treat the DOM as an external override, rewrite the
    editor and collapse the caret to offset 0. Zero-delay typing is the only
    thing that reaches that window.
    
    Generated-by: Claude Code
---
 apps/desktop/e2e/new-task-draft-target.spec.ts | 17 ++++++++++++++---
 1 file changed, 14 insertions(+), 3 deletions(-)

diff --git a/apps/desktop/e2e/new-task-draft-target.spec.ts b/apps/desktop/e2e/new-task-draft-target.spec.ts
index ce7b554c5b..866d109eb8 100644
--- a/apps/desktop/e2e/new-task-draft-target.spec.ts
+++ b/apps/desktop/e2e/new-task-draft-target.spec.ts
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-import type { Page } from '@playwright/test';
+import type { Locator, Page } from '@playwright/test';
 import { COMPOSER_INPUT, NEW_TASK_PROJECT_NAME, expect, test } from './fixtures';
 
 /**
@@ -50,6 +50,15 @@ async function settle(page: Page): Promise<void> {
   );
 }
 
+// Picking an item hides the menu, and DropdownMenu then swallows a reopen
+// click for 50ms.
+async function openPicker(page: Page, picker: Locator): Promise<void> {
+  await expect(async () => {
+    await picker.click();
+    await expect(page.getByRole('menuitem').first()).toBeVisible({ timeout: 500 });
+  }).toPass({ timeout: 10_000 });
+}
+
 test('the new-task draft follows the Project chosen under the composer', async ({
   newTaskTargetWindow: page,
 }) => {
@@ -62,7 +71,9 @@ test('the new-task draft follows the Project chosen under the composer', async (
   await expect(picker).toHaveAttribute('aria-label', new RegExp(NEW_TASK_PROJECT_NAME));
 
   await composer.click();
-  await page.keyboard.type(DRAFT);
+  // Two keystrokes in one frame — no human rate — make ChatComposerInput
+  // rewrite the editor and reset the caret.
+  await page.keyboard.type(DRAFT, { delay: 20 });
   await expect(composer).toHaveText(DRAFT);
 
   await picker.click();
@@ -74,7 +85,7 @@ test('the new-task draft follows the Project chosen under the composer', async (
   await settle(page);
   await expect(composer).toHaveText(DRAFT);
 
-  await picker.click();
+  await openPicker(page, picker);
   await page.getByRole('menuitem', { name: NEW_TASK_PROJECT_NAME, exact: true }).click();
   await expect(picker).toHaveAttribute('aria-label', new RegExp(NEW_TASK_PROJECT_NAME));
   await settle(page);


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@maka.apache.org
For additional commands, e-mail: commits-help@maka.apache.org