-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Expand file tree
/
Copy pathAppHeaderIcon.test.tsx
More file actions
49 lines (38 loc) · 1.31 KB
/
AppHeaderIcon.test.tsx
File metadata and controls
49 lines (38 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/**
* @license
* Copyright 2026 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
import { renderWithProviders } from '../../test-utils/render.js';
import { AppHeader } from './AppHeader.js';
// We mock the entire module to control the isAppleTerminal export
vi.mock('@google/gemini-cli-core', async (importOriginal) => {
const actual =
await importOriginal<typeof import('@google/gemini-cli-core')>();
return {
...actual,
isAppleTerminal: vi.fn(),
};
});
import { isAppleTerminal } from '@google/gemini-cli-core';
describe('AppHeader Icon Rendering', () => {
beforeEach(() => {
vi.clearAllMocks();
});
afterEach(() => {
vi.unstubAllEnvs();
});
it('renders the default icon in standard terminals', async () => {
vi.mocked(isAppleTerminal).mockReturnValue(false);
const result = renderWithProviders(<AppHeader version="1.0.0" />);
await result.waitUntilReady();
await expect(result).toMatchSvgSnapshot();
});
it('renders the symmetric icon in Apple Terminal', async () => {
vi.mocked(isAppleTerminal).mockReturnValue(true);
const result = renderWithProviders(<AppHeader version="1.0.0" />);
await result.waitUntilReady();
await expect(result).toMatchSvgSnapshot();
});
});