style(web): close control-system gaps found in the deep sweep

This commit is contained in:
chick
2026-09-08 08:02:01 +08:00
parent c0adbcbc8a
commit bfe5025943
7 changed files with 100 additions and 30 deletions
@@ -1,5 +1,5 @@
// @vitest-environment jsdom
import { cleanup, render, screen, within } from '@testing-library/react';
import { cleanup, render, screen, waitFor, within } from '@testing-library/react';
import userEvent from '@testing-library/user-event';
import { afterEach, describe, expect, it, vi } from 'vitest';
@@ -28,6 +28,11 @@ async function mount(overrides: Partial<SystemMaintenanceDataSource> = {}) {
const data = source(overrides);
const view = render(<ConnectionSettingsPanel dataSource={data} />);
const region = await screen.findByRole('region', { name: '连接设置' });
if (!overrides.connection) {
await waitFor(() => {
expect(within(region).getByLabelText('心跳间隔(秒)').value).toBe('30');
});
}
return { ...view, data, region };
}