address comments

This commit is contained in:
Christine Betts
2026-03-10 16:11:41 -04:00
parent f34821c79b
commit 76cd4beb95
3 changed files with 12 additions and 9 deletions
@@ -108,12 +108,16 @@ describe('ExtensionDetails', () => {
});
it('should NOT call onInstall when Enter is pressed and already installed', async () => {
vi.useFakeTimers();
const { stdin } = renderDetails(true);
await React.act(async () => {
stdin.write('\r'); // Enter
});
// Wait a bit to ensure it's not called
await new Promise((resolve) => setTimeout(resolve, 100));
// Advance timers to trigger the keypress flush
await React.act(async () => {
vi.runAllTimers();
});
expect(mockOnInstall).not.toHaveBeenCalled();
vi.useRealTimers();
});
});