import { jest } from "@jest/globals"; import xref from "../xref"; import { Prefetcher, initPrefetcher } from "../prefetch"; import { camelToKebab, kebabToCamel } from "../utils"; import { handlePartials, mergeOptions, reverseTransition } from "../partials"; describe("utils.ts", () => { test("camelToKebab()", () => { expect(camelToKebab("camelCase")).toBe("camel-case"); }); test("kebabToCamel()", () => { expect(kebabToCamel("kebab-case")).toBe("kebabCase"); }); }); describe("prefetch.ts", () => {}); describe("partials.ts", () => { test("mergeOptions()", () => { const partial = { element: ".test", in: { from: { opacity: 1, transform: "scale(1)" }, }, out: { to: { opacity: 0, transform: "scale(0)" }, }, duration: 1000, delay: 500, easing: "ease-in-out", }; const globalTransition = { duration: 2000, delay: 1000, easing: "ease-in", }; const index = 0; const result = mergeOptions(partial, globalTransition, index); expect(result).toEqual({ ...globalTransition, ...partial, duration: partial.duration, delay: partial.delay, easing: partial.easing, }); }); }); describe("xref.ts", () => {});