feat : dd up up
This commit is contained in:
@@ -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%");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user