test: optimize BaseSettingsDialog tests

This commit is contained in:
mkorwel
2026-04-20 19:13:28 +00:00
parent 07505318f6
commit 1690e0da38
@@ -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;