Files
gemini-cli/integration-tests/flicker.test.ts
T

40 lines
1.1 KiB
TypeScript
Raw Normal View History

2025-10-14 11:41:43 -07:00
/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/
import { describe, it, expect } from 'vitest';
import { TestRig } from './test-helper.js';
import { join } from 'node:path';
2025-10-14 11:41:43 -07:00
describe('Flicker Detector', () => {
it('should not detect a flicker under the max height budget', async () => {
2025-10-14 11:41:43 -07:00
const rig = new TestRig();
rig.setup('flicker-detector-test', {
fakeResponsesPath: join(
import.meta.dirname,
'flicker-detector.max-height.responses',
),
});
try {
const run = await rig.runInteractive();
const prompt = 'Tell me a fun fact.';
await run.type(prompt);
await run.type('\r');
2025-10-14 11:41:43 -07:00
const hasUserPromptEvent = await rig.waitForTelemetryEvent('user_prompt');
expect(hasUserPromptEvent).toBe(true);
2025-10-14 11:41:43 -07:00
const hasSessionCountMetric = await rig.waitForMetric('session.count');
expect(hasSessionCountMetric).toBe(true);
2025-10-14 11:41:43 -07:00
// We expect NO flicker event to be found.
const flickerMetric = rig.readMetric('ui.flicker.count');
expect(flickerMetric).toBeNull();
} finally {
await rig.cleanup();
}
2025-10-14 11:41:43 -07:00
});
});