refactor: tighten types and reuse instrument UI
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import { MantineProvider } from "@mantine/core";
|
||||
import { render, screen, within } from "@testing-library/react";
|
||||
import { MemoryRouter } from "react-router";
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { assert, describe, expect, it } from "vitest";
|
||||
|
||||
import { toAccountPagePositionSections } from "../../model/positions";
|
||||
import { portfolio, position, second } from "../../model/positions.fixtures";
|
||||
@@ -13,6 +13,8 @@ describe("Positions grouped by security", () => {
|
||||
...portfolio, positions: [position, second],
|
||||
})[0];
|
||||
|
||||
assert.isDefined(section);
|
||||
|
||||
render(
|
||||
<MantineProvider>
|
||||
<MemoryRouter>
|
||||
@@ -27,6 +29,8 @@ describe("Positions grouped by security", () => {
|
||||
).getAllByRole("listitem");
|
||||
|
||||
expect(rows).toHaveLength(2);
|
||||
assert.isDefined(rows[0]);
|
||||
assert.isDefined(rows[1]);
|
||||
expect(
|
||||
within(rows[0]).getByRole("link", { name: "Основной" }),
|
||||
).toHaveAttribute("href", "/accounts/a");
|
||||
|
||||
Reference in New Issue
Block a user