feat : dd up up
CI / Verify (push) Successful in 2m34s
CI / Build immutable images and deploy (push) Successful in 4m1s

This commit is contained in:
2026-10-07 18:15:27 +07:00 Unverified
parent a53abb0e2e
commit bec24ad00b
9 changed files with 73 additions and 69 deletions
@@ -1,6 +1,6 @@
import { renderToStaticMarkup } from "react-dom/server";
import { describe, expect, it } from "vitest";
import { ComparisonContext, ComparisonValue } from "./comparison-context";
import { ComparisonContext } from "./comparison-context";
describe("public comparison explanations", () => {
it("keeps each damage metric's 100% rows separate", () => {
@@ -24,12 +24,4 @@ describe("public comparison explanations", () => {
expect(html).not.toContain("Only choice");
});
it("renders a loss relative to the baseline but never treats an unavailable value as a loss", () => {
expect(renderToStaticMarkup(<ComparisonValue value="98.5" />)).toContain("-1.5%");
for (const value of [null, "0", "invalid"]) {
const html = renderToStaticMarkup(<ComparisonValue value={value} />);
expect(html).toContain("ไม่มีข้อมูลเปรียบเทียบ");
expect(html).not.toContain("-100%");
}
});
});