mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-05-23 02:02:31 -07:00
test: optimize BaseSettingsDialog tests
This commit is contained in:
@@ -87,6 +87,7 @@ describe('BaseSettingsDialog', () => {
|
||||
let mockOnScopeChange: ReturnType<typeof vi.fn>;
|
||||
|
||||
beforeEach(() => {
|
||||
vi.useFakeTimers();
|
||||
vi.clearAllMocks();
|
||||
mockOnItemToggle = vi.fn();
|
||||
mockOnEditCommit = vi.fn();
|
||||
@@ -95,6 +96,10 @@ describe('BaseSettingsDialog', () => {
|
||||
mockOnScopeChange = vi.fn();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
vi.useRealTimers();
|
||||
});
|
||||
|
||||
const renderDialog = async (props: Partial<BaseSettingsDialogProps> = {}) => {
|
||||
const defaultProps: BaseSettingsDialogProps = {
|
||||
title: 'Test Settings',
|
||||
@@ -110,6 +115,7 @@ describe('BaseSettingsDialog', () => {
|
||||
|
||||
const result = await renderWithProviders(
|
||||
<BaseSettingsDialog {...defaultProps} />,
|
||||
{ width: 100, height: 40 },
|
||||
);
|
||||
await result.waitUntilReady();
|
||||
return result;
|
||||
|
||||
Reference in New Issue
Block a user