refactor: address frontend review feedback
Frontend verify / commits (pull_request) Successful in 29s
Frontend verify / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 8m54s
Frontend verify / commits (push) Skipped
Frontend verify / security (push) Successful in 12s
Frontend verify / verify (push) Successful in 9m59s
Frontend verify / commits (pull_request) Successful in 29s
Frontend verify / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Successful in 8m54s
Frontend verify / commits (push) Skipped
Frontend verify / security (push) Successful in 12s
Frontend verify / verify (push) Successful in 9m59s
This commit was merged in pull request #43.
This commit is contained in:
@@ -67,8 +67,6 @@ function renderPage(ui: React.ReactNode) {
|
||||
);
|
||||
}
|
||||
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
const portfolio: Portfolio
|
||||
= {
|
||||
cashBalances: [{ currency: "USD", value: "0.5" }],
|
||||
@@ -103,7 +101,6 @@ const portfolio: Portfolio
|
||||
structure: { currencies: [], unvaluedCategories: [] },
|
||||
totalsByCurrency: [{ currency: "RUB", value: "1234.5" }],
|
||||
};
|
||||
/* eslint-enable unicorn/no-null */
|
||||
|
||||
const emptyRecentOperations: AccountPageRecentOperations = {
|
||||
state: "empty",
|
||||
@@ -146,8 +143,6 @@ describe("AccountPage states", () => {
|
||||
const uid = "c190ff1f-1447-4227-b543-316332699ca5";
|
||||
const requests = vi.fn();
|
||||
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
const position
|
||||
= {
|
||||
...portfolio.positions[0],
|
||||
@@ -158,7 +153,6 @@ describe("AccountPage states", () => {
|
||||
type,
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
server.use(
|
||||
http.get("*/api/v1/brokerage-accounts/:accountId/portfolio", () =>
|
||||
HttpResponse.json(
|
||||
@@ -483,7 +477,6 @@ describe("AccountPage states", () => {
|
||||
it("renders stock cards with logo fallback and signed unlabeled return", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
{...loadedProps(
|
||||
{
|
||||
...portfolio,
|
||||
@@ -514,7 +507,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
@@ -528,7 +520,6 @@ describe("AccountPage states", () => {
|
||||
it("groups stock supporting metrics into quiet single lines", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
{...loadedProps(
|
||||
{
|
||||
...portfolio,
|
||||
@@ -547,7 +538,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
@@ -563,7 +553,6 @@ describe("AccountPage states", () => {
|
||||
it("uses the ticker only for stock cards and otherwise keeps the ISIN", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
{...loadedProps(
|
||||
{
|
||||
...portfolio,
|
||||
@@ -606,7 +595,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
@@ -623,7 +611,6 @@ describe("AccountPage states", () => {
|
||||
it("renders bond cards with logo, fallback, and signed unlabeled return like stocks", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
{...loadedProps(
|
||||
{
|
||||
...portfolio,
|
||||
@@ -654,7 +641,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
@@ -674,7 +660,6 @@ describe("AccountPage states", () => {
|
||||
it("renders bond cards in expanded layout with bond-specific classes", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
{...loadedProps(
|
||||
{
|
||||
...portfolio,
|
||||
@@ -693,7 +678,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
@@ -707,7 +691,6 @@ describe("AccountPage states", () => {
|
||||
it("keeps other-position cards compact with labeled return and no logo", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
{...loadedProps(
|
||||
{
|
||||
...portfolio,
|
||||
@@ -726,7 +709,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
)}
|
||||
/>,
|
||||
);
|
||||
@@ -738,17 +720,14 @@ describe("AccountPage states", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
{...loadedProps()}
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
account={
|
||||
{
|
||||
id: "account-1",
|
||||
name: "Основной",
|
||||
openedOn: null,
|
||||
portfolioSummary: null,
|
||||
type: "BROKERAGE",
|
||||
}
|
||||
/* eslint-enable unicorn/no-null */
|
||||
}
|
||||
|
||||
account={{
|
||||
id: "account-1",
|
||||
name: "Основной",
|
||||
openedOn: null,
|
||||
portfolioSummary: null,
|
||||
type: "BROKERAGE",
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
expect(
|
||||
@@ -777,33 +756,30 @@ describe("AccountPage states", () => {
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
{...loadedProps()}
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
recentOperations={
|
||||
{
|
||||
items: [
|
||||
{
|
||||
accruedInterest: null,
|
||||
category: "trade",
|
||||
commission: null,
|
||||
description: "Покупка акции",
|
||||
figi: "FIGI-1",
|
||||
id: "operation-1",
|
||||
instrumentType: "share",
|
||||
instrumentUid: "UID-1",
|
||||
logoName: null,
|
||||
occurredAt: "2026-08-14T10:00:00Z",
|
||||
payment: { currency: "RUB", value: "-12" },
|
||||
price: null,
|
||||
quantity: null,
|
||||
ticker: "SBER",
|
||||
type: "OPERATION_TYPE_BUY",
|
||||
},
|
||||
],
|
||||
state: "loaded",
|
||||
to: "/accounts/account-1/operations",
|
||||
}
|
||||
/* eslint-enable unicorn/no-null */
|
||||
}
|
||||
|
||||
recentOperations={{
|
||||
items: [
|
||||
{
|
||||
accruedInterest: null,
|
||||
category: "trade",
|
||||
commission: null,
|
||||
description: "Покупка акции",
|
||||
figi: "FIGI-1",
|
||||
id: "operation-1",
|
||||
instrumentType: "share",
|
||||
instrumentUid: "UID-1",
|
||||
logoName: null,
|
||||
occurredAt: "2026-08-14T10:00:00Z",
|
||||
payment: { currency: "RUB", value: "-12" },
|
||||
price: null,
|
||||
quantity: null,
|
||||
ticker: "SBER",
|
||||
type: "OPERATION_TYPE_BUY",
|
||||
},
|
||||
],
|
||||
state: "loaded",
|
||||
to: "/accounts/account-1/operations",
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
@@ -812,7 +788,6 @@ describe("AccountPage states", () => {
|
||||
});
|
||||
|
||||
it("keeps future events ordered with calendar dates and projected rather than posted amounts", () => {
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
const event: BrokerageEvent
|
||||
= {
|
||||
date: "2026-09-10",
|
||||
@@ -827,41 +802,37 @@ describe("AccountPage states", () => {
|
||||
type: "coupon",
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
renderPage(
|
||||
<AccountPageLoaded
|
||||
{...loadedProps()}
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
recentEvents={
|
||||
{
|
||||
items: [
|
||||
event,
|
||||
{
|
||||
...event,
|
||||
date: "2026-09-11",
|
||||
dateKind: "registry",
|
||||
displayName: "Акция",
|
||||
projectedAmount: { currency: "USD", value: "0" },
|
||||
type: "dividend",
|
||||
},
|
||||
{
|
||||
...event,
|
||||
date: "2026-09-12",
|
||||
projectedAmount: { currency: "RUB", value: "1000" },
|
||||
type: "maturity",
|
||||
},
|
||||
{
|
||||
...event,
|
||||
date: "2026-09-13",
|
||||
projectedAmount: null,
|
||||
type: "offer",
|
||||
},
|
||||
],
|
||||
state: "loaded",
|
||||
to: "/accounts/account-1/events",
|
||||
}
|
||||
/* eslint-enable unicorn/no-null */
|
||||
}
|
||||
|
||||
recentEvents={{
|
||||
items: [
|
||||
event,
|
||||
{
|
||||
...event,
|
||||
date: "2026-09-11",
|
||||
dateKind: "registry",
|
||||
displayName: "Акция",
|
||||
projectedAmount: { currency: "USD", value: "0" },
|
||||
type: "dividend",
|
||||
},
|
||||
{
|
||||
...event,
|
||||
date: "2026-09-12",
|
||||
projectedAmount: { currency: "RUB", value: "1000" },
|
||||
type: "maturity",
|
||||
},
|
||||
{
|
||||
...event,
|
||||
date: "2026-09-13",
|
||||
projectedAmount: null,
|
||||
type: "offer",
|
||||
},
|
||||
],
|
||||
state: "loaded",
|
||||
to: "/accounts/account-1/events",
|
||||
}}
|
||||
/>,
|
||||
);
|
||||
|
||||
@@ -953,7 +924,6 @@ describe("AccountPage states", () => {
|
||||
it.each([503])(
|
||||
"preserves totals and UTC snapshot through refresh error %i, retry and success",
|
||||
async (status) => {
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
const initialPortfolio: Portfolio
|
||||
= {
|
||||
...portfolio,
|
||||
@@ -970,7 +940,6 @@ describe("AccountPage states", () => {
|
||||
},
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
let requestCount = 0;
|
||||
let resolveRetry: ((response: Response) => void) | undefined;
|
||||
server.use(
|
||||
@@ -985,7 +954,7 @@ describe("AccountPage states", () => {
|
||||
),
|
||||
),
|
||||
http.get("*/api/v1/tbank-sync/:id", () =>
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
HttpResponse.json(
|
||||
{
|
||||
errorCode: null,
|
||||
@@ -999,7 +968,6 @@ describe("AccountPage states", () => {
|
||||
scope: { accountId: "account-1", screen: "account" },
|
||||
state: "succeeded",
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
),
|
||||
http.get("*/api/v1/brokerage-accounts/:accountId/portfolio", () => {
|
||||
|
||||
Reference in New Issue
Block a user