You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
808 B
27 lines
808 B
import {COLOR_BAD, COLOR_GOOD, COLOR_VERY_BAD, COLOR_VERY_GOOD, colorByDiff} from "./color";
|
|
|
|
describe("colorByDiff", function () {
|
|
it("should show dark red for worse bad", () => {
|
|
expect(colorByDiff(-5, -2)).toBe(COLOR_VERY_BAD);
|
|
});
|
|
|
|
it("should show bright red for equal bad", () => {
|
|
expect(colorByDiff(-11, -11)).toBe(COLOR_BAD);
|
|
});
|
|
|
|
it("should show bright red for better bad", () => {
|
|
expect(colorByDiff(-1, -7)).toBe(COLOR_BAD);
|
|
});
|
|
|
|
it("should show dark green for better good", () => {
|
|
expect(colorByDiff(33, 25)).toBe(COLOR_VERY_GOOD);
|
|
});
|
|
|
|
it("should show bright green for equal good", () => {
|
|
expect(colorByDiff(10, 10)).toBe(COLOR_GOOD);
|
|
});
|
|
|
|
it("should show bright green for worse good", () => {
|
|
expect(colorByDiff(5, 7)).toBe(COLOR_GOOD);
|
|
});
|
|
});
|