feat: stabilize Xingtu market data sync

This commit is contained in:
2026-04-21 14:16:29 +08:00
parent 85e835a96a
commit 55324a5bb7
19 changed files with 2150 additions and 1366 deletions
+7
View File
@@ -2,6 +2,7 @@ import { describe, expect, test } from "vitest";
import {
compareRateValues,
normalizeFractionRateDisplay,
normalizeRateDisplay,
parseRateLowerBound
} from "../src/shared/rate-normalizer";
@@ -26,4 +27,10 @@ describe("rate-normalizer", () => {
test("orders missing values after real values", () => {
expect(compareRateValues(null, "0.02% - 0.1%")).toBeGreaterThan(0);
});
test("normalizes fraction rate values into percentage display", () => {
expect(normalizeFractionRateDisplay("0.0002")).toBe("0.02%");
expect(normalizeFractionRateDisplay("0.0044")).toBe("0.44%");
expect(normalizeFractionRateDisplay("0")).toBe("0%");
});
});