import { describe, test, expect } from "vitest"
import { recolorSvg, stripSvgWrapper } from "../src/recolor"
const SAMPLE = ``
describe("recolor — recolorSvg", () => {
test("replaces stroke=currentColor with accent", () => {
const out = recolorSvg(SAMPLE, "#ccff00")
expect(out).toContain('stroke="#ccff00"')
expect(out).not.toContain('stroke="currentColor"')
})
test("replaces fill (non-none) with target color", () => {
const svg = ``
const out = recolorSvg(svg, "#ccff00")
expect(out).toContain('fill="#ccff00"')
expect(out).not.toContain('fill="#000000"')
expect(out).not.toContain('fill="#ff0000"')
})
test("preserves fill=none", () => {
const svg = ``
const out = recolorSvg(svg, "#ccff00")
expect(out).toContain('fill="none"')
})
test("none color returns unchanged", () => {
expect(recolorSvg(SAMPLE, "none")).toBe(SAMPLE)
})
test("replaces stroke with fg color", () => {
const out = recolorSvg(SAMPLE, "#ededed")
expect(out).toContain('stroke="#ededed"')
})
test("replaces stroke with muted color", () => {
const out = recolorSvg(SAMPLE, "#a1a1aa")
expect(out).toContain('stroke="#a1a1aa"')
})
})
describe("recolor — stripSvgWrapper", () => {
test("extracts inner content", () => {
const inner = stripSvgWrapper(SAMPLE)
expect(inner).toContain("