Frontend security / security (push) Successful in 9s
Frontend verify / verify (push) Failing after 37m50s
Frontend security / security (pull_request) Successful in 9s
Frontend verify / verify (pull_request) Failing after 42m10s
Conventional commits / commits (pull_request) Successful in 29s
Enable every plugin recommended preset and replace Biome with ESLint formatting. Preserve API contracts and JSX whitespace; verify source, tests, builds and tooling.
36 lines
871 B
TypeScript
36 lines
871 B
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { type BankSummary, sortBankSummary } from "./queries";
|
|
|
|
const money = (value: string) => ({ currency: "RUB", value });
|
|
|
|
it("orders displayed expenses descending, preserving cents, ties and source data", () => {
|
|
const values = [
|
|
"-10",
|
|
"9007199254740992.01",
|
|
"0",
|
|
"9007199254740992.02",
|
|
"-2",
|
|
"0",
|
|
];
|
|
|
|
const data: BankSummary = {
|
|
cardId: "a",
|
|
categories: values.map((value, index) => ({
|
|
categoryId: String(index),
|
|
categoryName: String(index),
|
|
expenses: money("100"),
|
|
net: money(value),
|
|
refunds: money("0"),
|
|
})),
|
|
expenses: money("0"),
|
|
month: "2026-09",
|
|
net: money("0"),
|
|
refunds: money("0"),
|
|
};
|
|
expect(sortBankSummary(data).categories.map(row => row.categoryId)).toEqual(
|
|
["3", "1", "2", "5", "4", "0"],
|
|
);
|
|
expect(data.categories.map(row => row.net.value)).toEqual(values);
|
|
});
|