diff --git a/packages/cli/src/ui/components/Composer.test.tsx b/packages/cli/src/ui/components/Composer.test.tsx
index 73765dcf04..956130fffe 100644
--- a/packages/cli/src/ui/components/Composer.test.tsx
+++ b/packages/cli/src/ui/components/Composer.test.tsx
@@ -308,19 +308,19 @@ describe('Composer', () => {
expect(output).not.toContain('Should not show');
});
- it('does not render LoadingIndicator when waiting for confirmation', () => {
+ it('renders LoadingIndicator when waiting for confirmation', () => {
const uiState = createMockUIState({
streamingState: StreamingState.WaitingForConfirmation,
thought: {
subject: 'Confirmation',
- description: 'Should not show during confirmation',
+ description: 'Should show during confirmation',
},
});
const { lastFrame } = renderComposer(uiState);
const output = lastFrame();
- expect(output).not.toContain('LoadingIndicator');
+ expect(output).toContain('LoadingIndicator');
});
it('does not render LoadingIndicator when a tool confirmation is pending', () => {
diff --git a/packages/cli/src/ui/components/Footer.test.tsx b/packages/cli/src/ui/components/Footer.test.tsx
index 4113060081..cd28462bcd 100644
--- a/packages/cli/src/ui/components/Footer.test.tsx
+++ b/packages/cli/src/ui/components/Footer.test.tsx
@@ -128,7 +128,7 @@ describe('', () => {
}),
});
expect(lastFrame()).toContain(defaultProps.model);
- expect(lastFrame()).toMatch(/\(\d+% context left\)/);
+ expect(lastFrame()).toMatch(/\d+% context left/);
});
it('displays the model name and abbreviated context percentage', () => {
@@ -144,7 +144,7 @@ describe('', () => {
}),
});
expect(lastFrame()).toContain(defaultProps.model);
- expect(lastFrame()).toMatch(/\(\d+%\)/);
+ expect(lastFrame()).toMatch(/\d+%/);
});
describe('sandbox and trust info', () => {
@@ -289,9 +289,8 @@ describe('', () => {
}),
});
expect(lastFrame()).toContain(defaultProps.model);
- expect(lastFrame()).not.toMatch(/\(\d+% context left\)/);
+ expect(lastFrame()).not.toMatch(/\d+% context left/);
});
-
it('shows the context percentage when hideContextPercentage is false', () => {
const { lastFrame } = renderWithProviders(, {
width: 120,
@@ -305,9 +304,8 @@ describe('', () => {
}),
});
expect(lastFrame()).toContain(defaultProps.model);
- expect(lastFrame()).toMatch(/\(\d+% context left\)/);
+ expect(lastFrame()).toMatch(/\d+% context left/);
});
-
it('renders complete footer in narrow terminal (baseline narrow)', () => {
const { lastFrame } = renderWithProviders(, {
width: 79,
diff --git a/packages/cli/src/ui/components/LoadingIndicator.test.tsx b/packages/cli/src/ui/components/LoadingIndicator.test.tsx
index e76c4d49f3..bb01dcb691 100644
--- a/packages/cli/src/ui/components/LoadingIndicator.test.tsx
+++ b/packages/cli/src/ui/components/LoadingIndicator.test.tsx
@@ -57,12 +57,12 @@ describe('', () => {
elapsedTime: 5,
};
- it('should not render when streamingState is Idle and no loading phrase or thought', () => {
+ it('should render blank when streamingState is Idle and no loading phrase or thought', () => {
const { lastFrame } = renderWithContext(
,
StreamingState.Idle,
);
- expect(lastFrame()).toBe('');
+ expect(lastFrame()?.trim()).toBe('');
});
it('should render spinner, phrase, and time when streamingState is Responding', () => {
@@ -146,7 +146,7 @@ describe('', () => {
,
StreamingState.Idle,
);
- expect(lastFrame()).toBe(''); // Initial: Idle (no loading phrase)
+ expect(lastFrame()?.trim()).toBe(''); // Initial: Idle (no loading phrase)
// Transition to Responding
rerender(
@@ -183,7 +183,7 @@ describe('', () => {
,
);
- expect(lastFrame()).toBe(''); // Idle with no loading phrase
+ expect(lastFrame()?.trim()).toBe(''); // Idle with no loading phrase and no spinner
unmount();
});
diff --git a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap
index 4c870387ae..ebe9b0c291 100644
--- a/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap
+++ b/packages/cli/src/ui/components/__snapshots__/Footer.test.tsx.snap
@@ -1,8 +1,8 @@
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
-exports[` > footer configuration filtering (golden snapshots) > renders complete footer in narrow terminal (baseline narrow) > complete-footer-narrow 1`] = `" ...s/to/make/it/long no sandbox gemini-pro /model (100%)"`;
+exports[` > footer configuration filtering (golden snapshots) > renders complete footer in narrow terminal (baseline narrow) > complete-footer-narrow 1`] = `" ...s/to/make/it/long no sandbox /model gemini-pro 100%"`;
-exports[` > footer configuration filtering (golden snapshots) > renders complete footer with all sections visible (baseline) > complete-footer-wide 1`] = `" ...directories/to/make/it/long no sandbox (see /docs) gemini-pro /model (100% context left)"`;
+exports[` > footer configuration filtering (golden snapshots) > renders complete footer with all sections visible (baseline) > complete-footer-wide 1`] = `" ...directories/to/make/it/long no sandbox (see /docs) /model gemini-pro 100% context left"`;
exports[` > footer configuration filtering (golden snapshots) > renders footer with CWD and model info hidden to test alignment (only sandbox visible) > footer-only-sandbox 1`] = `" no sandbox (see /docs)"`;
diff --git a/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx b/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx
index df0a766fae..23da2131b2 100644
--- a/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx
+++ b/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx
@@ -76,9 +76,7 @@ describe('useLoadingIndicator', () => {
vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
const { result } = renderLoadingIndicatorHook(StreamingState.Idle);
expect(result.current.elapsedTime).toBe(0);
- expect(WITTY_LOADING_PHRASES).toContain(
- result.current.currentLoadingPhrase,
- );
+ expect(result.current.currentLoadingPhrase).toBeUndefined();
});
it('should show interactive shell waiting phrase when shouldShowFocusHint is true', async () => {
@@ -198,9 +196,7 @@ describe('useLoadingIndicator', () => {
});
expect(result.current.elapsedTime).toBe(0);
- expect(WITTY_LOADING_PHRASES).toContain(
- result.current.currentLoadingPhrase,
- );
+ expect(result.current.currentLoadingPhrase).toBeUndefined();
// Timer should not advance
await act(async () => {
diff --git a/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx b/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx
index 40b47664d1..62c5430f23 100644
--- a/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx
+++ b/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx
@@ -45,12 +45,12 @@ describe('usePhraseCycler', () => {
vi.restoreAllMocks();
});
- it('should initialize with a witty phrase when not active and not waiting', () => {
+ it('should initialize with an empty string when not active and not waiting', () => {
vi.spyOn(Math, 'random').mockImplementation(() => 0.5); // Always witty
const { lastFrame } = render(
,
);
- expect(WITTY_LOADING_PHRASES).toContain(lastFrame());
+ expect(lastFrame()).toBe('');
});
it('should show "Waiting for user confirmation..." when isWaiting is true', async () => {
@@ -195,7 +195,7 @@ describe('usePhraseCycler', () => {
});
expect(customPhrases).toContain(lastFrame()); // Should be one of the custom phrases
- // Deactivate -> resets to first phrase in sequence
+ // Deactivate -> resets to undefined (empty string in output)
rerender(
{
await act(async () => {
await vi.advanceTimersByTimeAsync(0);
});
- // The phrase should be the first phrase after reset
- expect(customPhrases).toContain(lastFrame());
+ // The phrase should be empty after reset
+ expect(lastFrame()).toBe('');
// Activate again -> this will show a tip on first activation, then cycle from where mock is
rerender(