summaryrefslogtreecommitdiff
path: root/apps/web/src/animation/__tests__/binding-values.test.ts
blob: a1f2010cf3f13eb663c54010e49453ca4795e208 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import { describe, expect, test } from "bun:test";
import {
	composeAnimationValue,
	createAnimationBinding,
} from "@/animation/binding-values";

describe("binding values", () => {
	test("formats composed animated colors as hex", () => {
		const binding = createAnimationBinding({
			path: "color",
			kind: "color",
		});

		expect(
			composeAnimationValue({
				binding,
				componentValues: {
					r: 1,
					g: 0,
					b: 0,
					a: 1,
				},
			}),
		).toBe("#ff0000");
	});
});