/// import { createComponentSafelist } from "./../../../utils/safelistUtils"; describe("Safelist create utils", () => { it("should return a tailwind's safelist object with sizes strings", () => { const safelistObject = createComponentSafelist("btn", { sizes: true, }); expect(safelistObject.pattern.toString()).to.be.equal("/btn-(xs|sm|lg)/"); }); it("should return a tailwind's safelist object with variants strings", () => { const safelistObject = createComponentSafelist("btn", { variants: true, }); expect(safelistObject.pattern.toString()).to.be.equal( "/btn-(primary|secondary|success|error|warning|info|ghost)/" ); }); it("should return a tailwind's safelist object with shapes strings", () => { const safelistObject = createComponentSafelist("btn", { shapes: true, }); expect(safelistObject.pattern.toString()).to.be.equal( "/btn-(square|circle)/" ); }); it("should return a tailwind's safelist object with selected variants strings", () => { const safelistObject = createComponentSafelist("btn", { variants: ["primary", "success", "error"], }); expect(safelistObject.pattern.toString()).to.be.equal( "/btn-(primary|success|error)/" ); }); it("should throw an Error if a invalid modifier is given", () => { const fn = createComponentSafelist.bind(createComponentSafelist, "btn", { variants: ["primary", "dark"], }); expect(fn).to.throw('Invalid DaisyUi modifier "dark"'); }); });