Refactor frontend API calls into hooks and complete task states
This commit is contained in:
@@ -41,6 +41,21 @@ const {
|
||||
// Mock the jail detail hook — tests control the returned state directly.
|
||||
vi.mock("../../hooks/useJails", () => ({
|
||||
useJailDetail: vi.fn(),
|
||||
useJailBannedIps: vi.fn(() => ({
|
||||
items: [],
|
||||
total: 0,
|
||||
page: 1,
|
||||
pageSize: 25,
|
||||
search: "",
|
||||
loading: false,
|
||||
error: null,
|
||||
opError: null,
|
||||
refresh: vi.fn(),
|
||||
setPage: vi.fn(),
|
||||
setPageSize: vi.fn(),
|
||||
setSearch: vi.fn(),
|
||||
unban: vi.fn(),
|
||||
})),
|
||||
}));
|
||||
|
||||
// Mock API functions used by JailInfoSection control buttons to avoid side effects.
|
||||
|
||||
Reference in New Issue
Block a user