refactor: align frontend ownership boundaries

Close audit gaps across API drift, query policy, UI, and tests.
This commit is contained in:
2026-09-06 18:20:05 +03:00
parent 175727bc93
commit c97f62bd98
118 changed files with 2190 additions and 2254 deletions
+8
View File
@@ -52,6 +52,14 @@ const handlers = [
events: [],
}),
),
http.get("*/api/v1/brokerage-accounts/:accountId/income-summary", () =>
HttpResponse.json({
accountId: "account-1",
period: { from: "2026-01-01", to: "2026-08-14" },
totalsByCurrency: [],
calculatedAt: "2026-08-14T00:00:00Z",
}),
),
];
export { handlers };
+23
View File
@@ -0,0 +1,23 @@
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import type { FC, PropsWithChildren } from "react";
function createTestQueryClient(): QueryClient {
return new QueryClient({
defaultOptions: {
queries: { retry: false },
mutations: { retry: false },
},
});
}
function createQueryWrapper(queryClient = createTestQueryClient()) {
const QueryWrapper: FC<PropsWithChildren> = (props) => (
<QueryClientProvider client={queryClient}>
{props.children}
</QueryClientProvider>
);
return { queryClient, wrapper: QueryWrapper };
}
export { createQueryWrapper, createTestQueryClient };
+7 -1
View File
@@ -1,10 +1,16 @@
import "@testing-library/jest-dom/vitest";
import { cleanup } from "@testing-library/react";
import { afterAll, afterEach, beforeAll } from "vitest";
import { configureAuthClient } from "@/shared/api";
import "../shared/i18n";
import { server } from "./server";
beforeAll(() => server.listen({ onUnhandledRequest: "error" }));
afterEach(() => server.resetHandlers());
afterEach(() => {
cleanup();
configureAuthClient(null);
server.resetHandlers();
});
afterAll(() => server.close());
class ResizeObserver {