2025-11-22 08:17:29 +05:30
|
|
|
/**
|
|
|
|
|
* @license
|
2026-03-02 13:12:17 -08:00
|
|
|
* Copyright 2026 Google LLC
|
2025-11-22 08:17:29 +05:30
|
|
|
* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import { render } from '../../test-utils/render.js';
|
|
|
|
|
import { Tips } from './Tips.js';
|
|
|
|
|
import { describe, it, expect, vi } from 'vitest';
|
|
|
|
|
import type { Config } from '@google/gemini-cli-core';
|
|
|
|
|
|
|
|
|
|
describe('Tips', () => {
|
|
|
|
|
it.each([
|
2026-03-02 13:12:17 -08:00
|
|
|
{ fileCount: 0, description: 'renders all tips including GEMINI.md tip' },
|
|
|
|
|
{ fileCount: 5, description: 'renders fewer tips when GEMINI.md exists' },
|
|
|
|
|
])('$description', async ({ fileCount }) => {
|
|
|
|
|
const config = {
|
|
|
|
|
getGeminiMdFileCount: vi.fn().mockReturnValue(fileCount),
|
|
|
|
|
} as unknown as Config;
|
2025-11-22 08:17:29 +05:30
|
|
|
|
2026-03-02 13:12:17 -08:00
|
|
|
const { lastFrame, waitUntilReady, unmount } = render(
|
|
|
|
|
<Tips config={config} />,
|
|
|
|
|
);
|
|
|
|
|
await waitUntilReady();
|
|
|
|
|
expect(lastFrame()).toMatchSnapshot();
|
|
|
|
|
unmount();
|
|
|
|
|
});
|
2025-11-22 08:17:29 +05:30
|
|
|
});
|