chore: update styles, exports, api, tests, and mark config redesign task complete
- configStyles.ts: add listDetailRoot, listPane, listItem, listItemSelected, detailPane style slots - index.ts: export ConfigListDetail and RawConfigSection - api/config.ts: add writeFilterFile and writeActionFile API helpers - setupTests.ts: add ResizeObserver and matchMedia mocks for Fluent UI v9 - ConfigPageLogPath.test.tsx: update to render inside FluentProvider - Docs/Tasks.md: mark config view redesign task as complete
This commit is contained in:
@@ -36,6 +36,7 @@ const {
|
||||
mockUpdateServerSettings,
|
||||
mockFlushLogs,
|
||||
mockSetJailConfigFileEnabled,
|
||||
mockUpdateJailConfigFile,
|
||||
} = vi.hoisted(() => ({
|
||||
mockAddLogPath: vi.fn<() => Promise<void>>().mockResolvedValue(undefined),
|
||||
mockDeleteLogPath: vi.fn<() => Promise<void>>().mockResolvedValue(undefined),
|
||||
@@ -73,6 +74,7 @@ const {
|
||||
mockUpdateServerSettings: vi.fn<() => Promise<void>>().mockResolvedValue(undefined),
|
||||
mockFlushLogs: vi.fn().mockResolvedValue({ message: "ok" }),
|
||||
mockSetJailConfigFileEnabled: vi.fn<() => Promise<void>>().mockResolvedValue(undefined),
|
||||
mockUpdateJailConfigFile: vi.fn<() => Promise<void>>().mockResolvedValue(undefined),
|
||||
}));
|
||||
|
||||
vi.mock("../../api/config", () => ({
|
||||
@@ -91,6 +93,7 @@ vi.mock("../../api/config", () => ({
|
||||
updateMapColorThresholds: mockUpdateMapColorThresholds,
|
||||
fetchJailConfigFiles: mockFetchJailConfigFiles,
|
||||
fetchJailConfigFileContent: vi.fn(),
|
||||
updateJailConfigFile: mockUpdateJailConfigFile,
|
||||
setJailConfigFileEnabled: mockSetJailConfigFileEnabled,
|
||||
fetchFilterFiles: mockFetchFilterFiles,
|
||||
fetchFilterFile: vi.fn(),
|
||||
@@ -104,6 +107,10 @@ vi.mock("../../api/config", () => ({
|
||||
testRegex: vi.fn(),
|
||||
}));
|
||||
|
||||
vi.mock("../../api/jails", () => ({
|
||||
fetchJails: vi.fn().mockResolvedValue({ jails: [], total: 0 }),
|
||||
}));
|
||||
|
||||
/** Minimal jail fixture used across tests. */
|
||||
const MOCK_JAIL: JailConfig = {
|
||||
name: "sshd",
|
||||
@@ -134,10 +141,10 @@ function renderConfigPage() {
|
||||
);
|
||||
}
|
||||
|
||||
/** Waits for the sshd accordion button to appear and clicks it open. */
|
||||
/** Waits for the sshd list item to appear and clicks it to open the detail pane. */
|
||||
async function openSshdAccordion(user: ReturnType<typeof userEvent.setup>) {
|
||||
const accordionBtn = await screen.findByRole("button", { name: /sshd/i });
|
||||
await user.click(accordionBtn);
|
||||
const listItem = await screen.findByRole("option", { name: /sshd/i });
|
||||
await user.click(listItem);
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user