import { Palette } from "../../Color/types"; import convertScalesToStitches from "./convertScalesToStitches"; const mockTheme = { blue: { blue1: { name: "blue1", data: { hsla: { h: 1, s: 1, l: 1, a: 1 }, rgbaString: "#003366", hslaString: "hsl(49, 92%, 20%)", hwbString: "#003366", codeName: "blue1", hexString: "#003366", }, }, }, red: { red1: { name: "red1", data: { hsla: { h: 1, s: 1, l: 1, a: 1 }, rgbaString: "#003366", hslaString: "hsl(49, 22%, 20%)", hwbString: "#003366", codeName: "red1", hexString: "#003366", }, }, }, } as Palette; describe("convertScalesToStitches", () => { it("Returns all the colors in a scale as an object with its hslaString as the value", () => { const output = convertScalesToStitches(mockTheme); expect(output).toEqual({ blue1: "hsl(49, 92%, 20%)", red1: "hsl(49, 22%, 20%)", }); }); });