mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-04-14 23:31:13 -07:00
Disable tips after 10 runs (#17101)
This commit is contained in:
@@ -4,12 +4,15 @@
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
import { describe, it, expect, vi } from 'vitest';
|
||||
import {
|
||||
renderWithProviders,
|
||||
persistentStateMock,
|
||||
} from '../../test-utils/render.js';
|
||||
import { describe, it, expect, vi, beforeEach } from 'vitest';
|
||||
import { AlternateBufferQuittingDisplay } from './AlternateBufferQuittingDisplay.js';
|
||||
import { ToolCallStatus } from '../types.js';
|
||||
import type { HistoryItem, HistoryItemWithoutId } from '../types.js';
|
||||
import { Text } from 'ink';
|
||||
import { renderWithProviders } from '../../test-utils/render.js';
|
||||
import type { Config } from '@google/gemini-cli-core';
|
||||
|
||||
vi.mock('../utils/terminalSetup.js', () => ({
|
||||
@@ -98,6 +101,9 @@ const mockConfig = {
|
||||
} as unknown as Config;
|
||||
|
||||
describe('AlternateBufferQuittingDisplay', () => {
|
||||
beforeEach(() => {
|
||||
vi.clearAllMocks();
|
||||
});
|
||||
const baseUIState = {
|
||||
terminalWidth: 80,
|
||||
mainAreaWidth: 80,
|
||||
@@ -112,6 +118,7 @@ describe('AlternateBufferQuittingDisplay', () => {
|
||||
};
|
||||
|
||||
it('renders with active and pending tool messages', () => {
|
||||
persistentStateMock.setData({ tipsShown: 0 });
|
||||
const { lastFrame } = renderWithProviders(
|
||||
<AlternateBufferQuittingDisplay />,
|
||||
{
|
||||
@@ -127,6 +134,7 @@ describe('AlternateBufferQuittingDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders with empty history and no pending items', () => {
|
||||
persistentStateMock.setData({ tipsShown: 0 });
|
||||
const { lastFrame } = renderWithProviders(
|
||||
<AlternateBufferQuittingDisplay />,
|
||||
{
|
||||
@@ -142,6 +150,7 @@ describe('AlternateBufferQuittingDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders with history but no pending items', () => {
|
||||
persistentStateMock.setData({ tipsShown: 0 });
|
||||
const { lastFrame } = renderWithProviders(
|
||||
<AlternateBufferQuittingDisplay />,
|
||||
{
|
||||
@@ -157,6 +166,7 @@ describe('AlternateBufferQuittingDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders with pending items but no history', () => {
|
||||
persistentStateMock.setData({ tipsShown: 0 });
|
||||
const { lastFrame } = renderWithProviders(
|
||||
<AlternateBufferQuittingDisplay />,
|
||||
{
|
||||
@@ -172,6 +182,7 @@ describe('AlternateBufferQuittingDisplay', () => {
|
||||
});
|
||||
|
||||
it('renders with user and gemini messages', () => {
|
||||
persistentStateMock.setData({ tipsShown: 0 });
|
||||
const history: HistoryItem[] = [
|
||||
{ id: 1, type: 'user', text: 'Hello Gemini' },
|
||||
{ id: 2, type: 'gemini', text: 'Hello User!' },
|
||||
|
||||
Reference in New Issue
Block a user