diff --git a/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx b/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx index e0ae9b5f20..c4bd9857d6 100644 --- a/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx +++ b/packages/cli/src/ui/hooks/useLoadingIndicator.test.tsx @@ -107,9 +107,11 @@ describe('useLoadingIndicator', () => { ); // Initially should be witty phrase or tip - expect([...WITTY_LOADING_PHRASES, ...INFORMATIVE_TIPS]).toContain( - result.current.currentLoadingPhrase, - ); + const possiblePhrases = [ + ...WITTY_LOADING_PHRASES, + ...INFORMATIVE_TIPS.map((tip) => `Tip: ${tip}`), + ]; + expect(possiblePhrases).toContain(result.current.currentLoadingPhrase); await act(async () => { rerender({ diff --git a/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx b/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx index ca89c623ac..c79d82c463 100644 --- a/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx +++ b/packages/cli/src/ui/hooks/usePhraseCycler.test.tsx @@ -141,7 +141,11 @@ describe('usePhraseCycler', () => { await waitUntilReady(); // Initial phrase on first activation should be a tip - expect(INFORMATIVE_TIPS).toContain(lastFrame().trim()); + await act(async () => { + await vi.advanceTimersByTimeAsync(0); + }); + expect(lastFrame()?.startsWith('Tip: ')).toBe(true); + expect(INFORMATIVE_TIPS).toContain(lastFrame()!.replace('Tip: ', '')); // After the first interval, it should be a witty phrase await act(async () => { diff --git a/packages/cli/src/ui/hooks/usePhraseCycler.ts b/packages/cli/src/ui/hooks/usePhraseCycler.ts index 8ddab6eef9..6f9dd0a066 100644 --- a/packages/cli/src/ui/hooks/usePhraseCycler.ts +++ b/packages/cli/src/ui/hooks/usePhraseCycler.ts @@ -89,7 +89,10 @@ export const usePhraseCycler = ( } const randomIndex = Math.floor(Math.random() * phraseList.length); - setCurrentLoadingPhrase(phraseList[randomIndex]); + const phrase = phraseList[randomIndex]; + setCurrentLoadingPhrase( + phraseList === INFORMATIVE_TIPS ? `Tip: ${phrase}` : phrase, + ); }; // Select an initial random phrase