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

This commit was merged in pull request #43.
This commit is contained in:
2026-09-28 19:20:32 +03:00
parent ca0ad4f824
commit a4046dbe87
139 changed files with 1549 additions and 941 deletions
@@ -135,12 +135,11 @@ describe("page-owned screen synchronization", () => {
expect(modes).toEqual(
cached
? [
null, // eslint-disable-line unicorn/no-null -- Preserve explicit null in the API fixture.
// eslint-disable-next-line unicorn/no-null -- Exercise the explicit null returned by the production API/DOM contract.
null,
null,
"observe",
]
: [null, "observe"], // eslint-disable-line unicorn/no-null -- Preserve explicit null in the API fixture.
: [null, "observe"],
);
expect(posts).toBe(0);
expect(result.current.disabled.data).toBeUndefined();
@@ -316,7 +315,7 @@ describe("page-owned screen synchronization", () => {
await waitFor(() => expect(result.current.accounts.isSuccess).toBe(true));
expect(result.current.accounts.data).toEqual([]);
// eslint-disable-next-line unicorn/no-null -- Preserve the API/DOM null sentinel in the expected response.
expect(modes).toEqual([null, "observe"]);
expect(
queryClient
@@ -357,8 +356,6 @@ describe("page-owned screen synchronization", () => {
http.get("*/api/v1/tbank-sync/:id", () => {
polls++;
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
return HttpResponse.json(
{
errorCode: null,
@@ -369,7 +366,6 @@ describe("page-owned screen synchronization", () => {
scope: { screen: "accounts" },
state: "succeeded",
},
/* eslint-enable unicorn/no-null */
);
}),
);
@@ -397,14 +393,14 @@ describe("page-owned screen synchronization", () => {
expect(result.current.accounts.meta?.stateVersion).toBe("2"),
);
expect(bodies).toEqual([{ screen: "accounts" }]);
// eslint-disable-next-line unicorn/no-null -- Preserve the API/DOM null sentinel in the expected response.
expect(modes).toEqual([null, "observe"]);
vi.useFakeTimers();
try {
await act(() => vi.advanceTimersByTimeAsync(120_000));
expect(polls).toBe(1);
// eslint-disable-next-line unicorn/no-null -- Preserve the API/DOM null sentinel in the expected response.
expect(modes).toEqual([null, "observe"]);
unmount();
await vi.advanceTimersByTimeAsync(120_000);
@@ -429,10 +425,10 @@ describe("page-owned screen synchronization", () => {
resource(
isCompleted
? []
: null, // eslint-disable-line unicorn/no-null -- Preserve the nullable API fixture.
: null,
{
stateVersion: isCompleted ? "covered" : "initial",
sync: { errorCode: null, id: "history", state: "running" }, // eslint-disable-line unicorn/no-null -- Preserve explicit null in the API fixture.
sync: { errorCode: null, id: "history", state: "running" },
},
);
@@ -445,8 +441,6 @@ describe("page-owned screen synchronization", () => {
http.get("*/api/v1/tbank-sync/:id", () => {
polls++;
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
return HttpResponse.json(
{
errorCode: null,
@@ -461,7 +455,6 @@ describe("page-owned screen synchronization", () => {
scope: null,
state: "running",
},
/* eslint-enable unicorn/no-null */
);
}),
);
@@ -493,7 +486,7 @@ describe("page-owned screen synchronization", () => {
await act(async () => {
await new Promise(resolve => setTimeout(resolve, 1100));
});
// eslint-disable-next-line unicorn/no-null -- Preserve the API/DOM null sentinel in the expected response.
expect(modes).toEqual([null, "observe"]);
if (boundary === "leave") unmount();
else act(() => configureAuthClient());
@@ -515,12 +508,11 @@ describe("page-owned screen synchronization", () => {
http.get("*/api/v1/brokerage-accounts", () =>
HttpResponse.json(
resource(
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
[],
{
sync: { errorCode: null, id: "revoked", state: "running" },
},
/* eslint-enable unicorn/no-null */
),
),
),
@@ -550,7 +542,7 @@ describe("page-owned screen synchronization", () => {
const modes: (null | string)[] = [];
const dependency = resource(
/* eslint-disable unicorn/no-null -- Fixture preserves the production contract’s explicit null values. */
[],
{
resourceKey: "operations",
@@ -561,7 +553,6 @@ describe("page-owned screen synchronization", () => {
state: isObserved ? "idle" : "running",
},
},
/* eslint-enable unicorn/no-null */
).meta;
server.use(
@@ -574,7 +565,7 @@ describe("page-owned screen synchronization", () => {
resource(
isObserved
? []
: null, // eslint-disable-line unicorn/no-null -- Exercise the explicit null returned by the production API/DOM contract.
: null,
{
dependencies: [
{
@@ -588,7 +579,7 @@ describe("page-owned screen synchronization", () => {
);
}),
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,
@@ -599,7 +590,6 @@ describe("page-owned screen synchronization", () => {
scope: null,
state: "succeeded",
},
/* eslint-enable unicorn/no-null */
),
),
);
@@ -615,7 +605,7 @@ describe("page-owned screen synchronization", () => {
);
await waitFor(() => expect(result.current.data).toEqual([]));
// eslint-disable-next-line unicorn/no-null -- Preserve the API/DOM null sentinel in the expected response.
expect(modes).toEqual([null, "observe"]);
});