17 lines
995 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { describe, expect, it } from "vitest";
import { cardPropsEqual, type CardProps } from "./Card.tsx";
const node = { key: "A-1" } as CardProps["node"];
const base: CardProps = { node, box: { x: 1, y: 2, w: 240, h: 120 }, rel: undefined, multiSprint: false, sprintSel: new Set() };
describe("cardPropsEqual (T11.1)", () => {
it("новый объект box с теми же числами — карточка не перерисовывается", () => {
expect(cardPropsEqual(base, { ...base, box: { x: 1, y: 2, w: 240, h: 120 } })).toBe(true);
});
it("сдвиг, другая карточка или другой выбор спринтов — перерисовка", () => {
expect(cardPropsEqual(base, { ...base, box: { x: 9, y: 2, w: 240, h: 120 } })).toBe(false);
expect(cardPropsEqual(base, { ...base, node: { key: "A-2" } as CardProps["node"] })).toBe(false);
expect(cardPropsEqual(base, { ...base, sprintSel: new Set(["S"]) })).toBe(false);
});
});