refactor: refactor foundation
This commit is contained in:
@@ -4,23 +4,12 @@ import { cleanup, render, screen, waitFor } from "@testing-library/react";
|
||||
import { MemoryRouter } from "react-router";
|
||||
import { afterEach, describe, expect, it, vi } from "vitest";
|
||||
|
||||
vi.mock("../../shared/api", async (importOriginal) => {
|
||||
const actual = await importOriginal<typeof import("../../shared/api")>();
|
||||
return {
|
||||
...actual,
|
||||
apiClient: {
|
||||
...actual.apiClient,
|
||||
POST: vi.fn(async () => ({ data: undefined })),
|
||||
},
|
||||
};
|
||||
});
|
||||
|
||||
import { AuthProvider } from "../../features/auth";
|
||||
import { AuthProvider } from "@/features/auth";
|
||||
import {
|
||||
AccountsPageEmpty,
|
||||
AccountsPageError,
|
||||
AccountsPageLoading,
|
||||
} from "../../pages/accounts";
|
||||
} from "@/pages/accounts";
|
||||
import { theme } from "../theme";
|
||||
import { AppRoutes } from "./AppRoutes";
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { Navigate, Route, Routes, useLocation } from "react-router";
|
||||
import { useAuth } from "../../features/auth";
|
||||
import { AccountPage } from "../../pages/account";
|
||||
import { AccountsPage } from "../../pages/accounts";
|
||||
import { LoginPage } from "../../pages/login";
|
||||
import { NotFoundPage } from "../../pages/not-found";
|
||||
import { RegisterPage } from "../../pages/register";
|
||||
import { SettingsPage } from "../../pages/settings";
|
||||
import { AppShell } from "../../shared/ui/AppShell";
|
||||
import { useAuth } from "@/features/auth";
|
||||
import { AccountPage } from "@/pages/account";
|
||||
import { AccountsPage } from "@/pages/accounts";
|
||||
import { LoginPage } from "@/pages/login";
|
||||
import { NotFoundPage } from "@/pages/not-found";
|
||||
import { RegisterPage } from "@/pages/register";
|
||||
import { SettingsPage } from "@/pages/settings";
|
||||
import { AppShell } from "@/shared/ui";
|
||||
|
||||
function Protected({ children }: { children: React.ReactNode }) {
|
||||
const { user, ready } = useAuth();
|
||||
|
||||
+3
-3
@@ -1,9 +1,9 @@
|
||||
import { MantineProvider } from "@mantine/core";
|
||||
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
||||
import { BrowserRouter } from "react-router";
|
||||
import { AuthProvider } from "../../features/auth";
|
||||
import { AppRoutes } from "../routes";
|
||||
import { theme } from "../theme";
|
||||
import { AppRoutes } from "@/app/routes";
|
||||
import { theme } from "@/app/theme";
|
||||
import { AuthProvider } from "@/features/auth";
|
||||
|
||||
const queryClient = new QueryClient({
|
||||
defaultOptions: { queries: { refetchOnWindowFocus: false } },
|
||||
|
||||
Reference in New Issue
Block a user