refactor: simplify errors and focus tests
This commit is contained in:
@@ -210,23 +210,9 @@ describe("useAccountPageViewModel", () => {
|
||||
expect(snapshot).toEqual(original);
|
||||
});
|
||||
|
||||
it("prepares grouped position sections with derived display data", async () => {
|
||||
configureTestAuth();
|
||||
mockLoadedAccountPage();
|
||||
|
||||
const { result } = renderHook(() => useAccountPageViewModel(), {
|
||||
wrapper: createWrapper(),
|
||||
});
|
||||
|
||||
await waitFor(() => expect(result.current.state).toBe("loaded"));
|
||||
|
||||
const loaded = result.current as Extract<
|
||||
typeof result.current,
|
||||
{ state: "loaded" }
|
||||
>;
|
||||
|
||||
it("prepares grouped position sections with derived display data", () => {
|
||||
expect(
|
||||
loaded.positionSections.map(({ groups, kind }) => ({
|
||||
toAccountPagePositionSections(portfolio).map(({ groups, kind }) => ({
|
||||
kind,
|
||||
positions: groups.flatMap(group => group.positions),
|
||||
})),
|
||||
|
||||
Reference in New Issue
Block a user