refactor: clarify frontend model ownership
This commit is contained in:
@@ -24,8 +24,8 @@ import type {
|
||||
AccountPageRecentOperations,
|
||||
} from "./AccountPage.vm";
|
||||
|
||||
import { toAccountPagePositionSections } from "../../model/positions";
|
||||
import { AccountPage } from "./AccountPage";
|
||||
import { toAccountPagePositionSections } from "./AccountPage.vm";
|
||||
import { AccountPageEmpty } from "./components/AccountPageEmpty.view";
|
||||
import { AccountPageError } from "./components/AccountPageError.view";
|
||||
import { AccountPageLoaded } from "./components/AccountPageLoaded.view";
|
||||
@@ -39,13 +39,13 @@ function configureTestAuth() {
|
||||
});
|
||||
}
|
||||
|
||||
function renderAccountRoute(queryClient: QueryClient) {
|
||||
function renderAccountRoute(queryClient: QueryClient, accountId = "account-1") {
|
||||
configureTestAuth();
|
||||
|
||||
return render(
|
||||
<QueryClientProvider client={queryClient}>
|
||||
<MantineProvider>
|
||||
<MemoryRouter initialEntries={["/accounts/account-1"]}>
|
||||
<MemoryRouter initialEntries={[`/accounts/${accountId}`]}>
|
||||
<Routes>
|
||||
<Route element={<AccountPage />} path="/accounts/:accountId" />
|
||||
</Routes>
|
||||
@@ -202,7 +202,7 @@ describe("AccountPage states", () => {
|
||||
}),
|
||||
);
|
||||
configureTestAuth();
|
||||
renderPage(<AccountPage accountId={accountId} />);
|
||||
renderAccountRoute(createTestQueryClient(), accountId);
|
||||
await waitFor(() => {
|
||||
const links = screen.getAllByRole("link", {
|
||||
name: position.displayName,
|
||||
|
||||
Reference in New Issue
Block a user