feat: stabilize Xingtu market data sync
This commit is contained in:
@@ -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%");
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user