From 395791feeb8f354504767b839ef01f2a5cd6f322 Mon Sep 17 00:00:00 2001
From: liqoingyu
Date: Sun, 18 Jan 2026 21:21:44 +0800
Subject: [PATCH 1/2] test(cli): stabilize AuthDialog ESC assertion
---
packages/cli/src/ui/auth/AuthDialog.test.tsx | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/packages/cli/src/ui/auth/AuthDialog.test.tsx b/packages/cli/src/ui/auth/AuthDialog.test.tsx
index 610cb1152..b33caf649 100644
--- a/packages/cli/src/ui/auth/AuthDialog.test.tsx
+++ b/packages/cli/src/ui/auth/AuthDialog.test.tsx
@@ -438,9 +438,10 @@ describe('AuthDialog', () => {
await wait();
// Should show error message instead of calling handleAuthSelect
- expect(lastFrame()).toContain(
- 'You must select an auth method to proceed. Press Ctrl+C again to exit.',
- );
+ await vi.waitFor(() => {
+ expect(lastFrame()).toContain('You must select an auth method');
+ });
+ expect(lastFrame()).toContain('Press Ctrl+C again to exit');
expect(handleAuthSelect).not.toHaveBeenCalled();
unmount();
});
From 1527c0333f49bfc2227b38a7147ec31c293eafc2 Mon Sep 17 00:00:00 2001
From: liqoingyu
Date: Mon, 19 Jan 2026 11:52:49 +0800
Subject: [PATCH 2/2] test(cli): wait for full auth error copy
---
packages/cli/src/ui/auth/AuthDialog.test.tsx | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/packages/cli/src/ui/auth/AuthDialog.test.tsx b/packages/cli/src/ui/auth/AuthDialog.test.tsx
index b33caf649..83208614f 100644
--- a/packages/cli/src/ui/auth/AuthDialog.test.tsx
+++ b/packages/cli/src/ui/auth/AuthDialog.test.tsx
@@ -439,9 +439,10 @@ describe('AuthDialog', () => {
// Should show error message instead of calling handleAuthSelect
await vi.waitFor(() => {
- expect(lastFrame()).toContain('You must select an auth method');
+ const frame = lastFrame();
+ expect(frame).toContain('You must select an auth method');
+ expect(frame).toContain('Press Ctrl+C again to exit');
});
- expect(lastFrame()).toContain('Press Ctrl+C again to exit');
expect(handleAuthSelect).not.toHaveBeenCalled();
unmount();
});