refactor: refactor foundation
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { HttpResponse, http } from "msw";
|
||||
|
||||
const authentication = {
|
||||
accessToken: "test-token",
|
||||
user: { id: "user-1", email: "user@example.com" },
|
||||
};
|
||||
|
||||
export const handlers = [
|
||||
http.post("*/api/v1/auth/register", () => HttpResponse.json(authentication)),
|
||||
http.post("*/api/v1/auth/login", () => HttpResponse.json(authentication)),
|
||||
http.post("*/api/v1/auth/refresh", () =>
|
||||
HttpResponse.json({ code: "UNAUTHORIZED" }, { status: 401 }),
|
||||
),
|
||||
http.post(
|
||||
"*/api/v1/auth/logout",
|
||||
() => new HttpResponse(null, { status: 204 }),
|
||||
),
|
||||
http.get("*/api/v1/auth/me", () => HttpResponse.json(authentication.user)),
|
||||
http.get("*/api/v1/tbank-connection", () =>
|
||||
HttpResponse.json({ connected: false, connectedAt: null }),
|
||||
),
|
||||
http.put("*/api/v1/tbank-connection", () =>
|
||||
HttpResponse.json({ connected: true, connectedAt: "2026-08-14T00:00:00Z" }),
|
||||
),
|
||||
http.delete(
|
||||
"*/api/v1/tbank-connection",
|
||||
() => new HttpResponse(null, { status: 204 }),
|
||||
),
|
||||
http.get("*/api/v1/brokerage-accounts", () => HttpResponse.json([])),
|
||||
http.get("*/api/v1/brokerage-accounts/:accountId/portfolio", () =>
|
||||
HttpResponse.json({
|
||||
lastSuccessfulAt: "2026-08-14T00:00:00Z",
|
||||
isStale: false,
|
||||
totalsByCurrency: [],
|
||||
positions: [],
|
||||
cashBalances: [],
|
||||
}),
|
||||
),
|
||||
];
|
||||
Reference in New Issue
Block a user