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:
@@ -29,8 +29,6 @@ const LocationProbe = () => {
|
||||
const uid = "e6123145-9665-43e0-8413-cd61b8aa9b13";
|
||||
const money = (value: string) => ({ currency: "RUB", value });
|
||||
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
const stock
|
||||
= {
|
||||
currency: "RUB",
|
||||
@@ -44,7 +42,6 @@ const stock
|
||||
ticker: "TEST",
|
||||
};
|
||||
|
||||
/* eslint-enable unicorn/no-null */
|
||||
const position = {
|
||||
absoluteReturn: money("1000"),
|
||||
accounts: [
|
||||
@@ -124,7 +121,7 @@ function setup(
|
||||
);
|
||||
if (params.section === "candles")
|
||||
return HttpResponse.json(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
resource(
|
||||
{
|
||||
candles: [],
|
||||
@@ -132,14 +129,13 @@ function setup(
|
||||
historyFrom: null,
|
||||
observedAt: quote.observedAt,
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
);
|
||||
if (params.section === "company")
|
||||
return options.failCompany
|
||||
? HttpResponse.json({ code: "TBANK_UNAVAILABLE" }, { status: 503 })
|
||||
: HttpResponse.json(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
resource(
|
||||
{
|
||||
description: "Описание компании",
|
||||
@@ -155,12 +151,11 @@ function setup(
|
||||
observedAt: quote.observedAt,
|
||||
unavailable: [],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
);
|
||||
|
||||
return HttpResponse.json(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
resource(
|
||||
{
|
||||
dividends: [
|
||||
@@ -188,7 +183,6 @@ function setup(
|
||||
positionIsStale: false,
|
||||
to: "2027-09-10",
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
);
|
||||
}),
|
||||
@@ -200,7 +194,7 @@ function setup(
|
||||
return HttpResponse.json({ code: cursorError }, { status: 400 });
|
||||
|
||||
return HttpResponse.json(
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
|
||||
resource(
|
||||
{
|
||||
accountId: "all",
|
||||
@@ -225,7 +219,6 @@ function setup(
|
||||
nextCursor: isNext ? null : "next",
|
||||
observedAt: quote.observedAt,
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
),
|
||||
);
|
||||
}),
|
||||
@@ -264,7 +257,6 @@ function setup(
|
||||
|
||||
describe("stock page", () => {
|
||||
it("preserves unknown and unambiguous currencies with compact, ratio and percent formatting", async () => {
|
||||
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
|
||||
setup(
|
||||
{
|
||||
metrics: [
|
||||
@@ -312,7 +304,6 @@ describe("stock page", () => {
|
||||
},
|
||||
],
|
||||
},
|
||||
/* eslint-enable unicorn/no-null */
|
||||
);
|
||||
expect(await screen.findByText("1,23 млн валюта неизвестна")).toBeVisible();
|
||||
for (const value of [
|
||||
@@ -468,9 +459,8 @@ describe("stock page", () => {
|
||||
it.each([
|
||||
[
|
||||
"INVALID_OPERATIONS_CURSOR",
|
||||
// eslint-disable-next-line unicorn/no-null -- Exercise the explicit null returned by the production API/DOM contract.
|
||||
null,
|
||||
null, // eslint-disable-line unicorn/no-null -- Preserve explicit null in the API fixture.
|
||||
null,
|
||||
],
|
||||
["TBANK_UNAVAILABLE", "next", "observe"],
|
||||
])(
|
||||
|
||||
@@ -146,9 +146,7 @@ const StockPageView: FC<StockPageViewProps> = (props) => {
|
||||
);
|
||||
}
|
||||
else {
|
||||
companyMetricsContent = (
|
||||
<Text c="dimmed">{t("stock.noFundamentals")}</Text>
|
||||
);
|
||||
companyMetricsContent = <Text c="dimmed">{t("stock.noFundamentals")}</Text>;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -219,9 +217,7 @@ const StockPageView: FC<StockPageViewProps> = (props) => {
|
||||
</Text>
|
||||
)}
|
||||
|
||||
{stock.lot !== null && (
|
||||
<Text size="sm">{t("stock.lot", { value: stock.lot })}</Text>
|
||||
)}
|
||||
{stock.lot !== null && <Text size="sm">{t("stock.lot", { value: stock.lot })}</Text>}
|
||||
</Group>
|
||||
|
||||
{!!vm.company && (
|
||||
|
||||
@@ -92,7 +92,7 @@ function useStockPageVm() {
|
||||
const averageLine
|
||||
= average && average.currency === candles.data?.currency
|
||||
? Number(average.value)
|
||||
: null; // eslint-disable-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
|
||||
: null;
|
||||
|
||||
const companyData = company.data;
|
||||
const search = parameters.size > 0 ? `?${parameters.toString()}` : "";
|
||||
@@ -101,13 +101,13 @@ function useStockPageVm() {
|
||||
averageLine:
|
||||
averageLine !== null && Number.isFinite(averageLine)
|
||||
? averageLine
|
||||
: null, // eslint-disable-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
|
||||
: null,
|
||||
candles: candles.data,
|
||||
candlesState: section(candles, sync.retry),
|
||||
canonicalTo:
|
||||
stock.data?.slug && stock.data.slug !== stockId
|
||||
? `/stocks/${encodeURIComponent(stock.data.slug)}${search}`
|
||||
: null, // eslint-disable-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
|
||||
: null,
|
||||
chartData,
|
||||
code: apiErrorCode(stock.error),
|
||||
company: companyData,
|
||||
@@ -120,12 +120,12 @@ function useStockPageVm() {
|
||||
logoName:
|
||||
item.logoName
|
||||
?? stock.data?.logoName
|
||||
// eslint-disable-next-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
|
||||
|
||||
?? null,
|
||||
ticker:
|
||||
item.ticker
|
||||
?? stock.data?.ticker
|
||||
// eslint-disable-next-line unicorn/no-null -- Preserve the nullable domain value consumed by this view model.
|
||||
|
||||
?? null,
|
||||
})) ?? [],
|
||||
filter,
|
||||
|
||||
@@ -162,9 +162,7 @@ const StockDividends: FC<StockEventsProps> = (props) => {
|
||||
);
|
||||
}
|
||||
else {
|
||||
pastDividendsContent = (
|
||||
<Text c="dimmed">{t("stock.noDividends")}</Text>
|
||||
);
|
||||
pastDividendsContent = <Text c="dimmed">{t("stock.noDividends")}</Text>;
|
||||
}
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user