import { describe, it, expect } from "vitest"; import { mount } from "@vue/test-utils"; import KindBadge from "../KindBadge.vue"; describe("KindBadge", () => { it("renders slot content", () => { const wrapper = mount(KindBadge, { slots: { default: "active" } }); expect(wrapper.text()).toBe("active"); }); it("applies the active variant by default style set", () => { const wrapper = mount(KindBadge, { props: { variant: "active" }, slots: { default: "active" }, }); expect(wrapper.classes().join(" ")).toMatch(/emerald/); }); it("applies the sunset variant style", () => { const wrapper = mount(KindBadge, { props: { variant: "sunset" }, slots: { default: "sunset" }, }); expect(wrapper.classes().join(" ")).toMatch(/rose/); }); it("falls back to neutral when no variant", () => { const wrapper = mount(KindBadge, { slots: { default: "n" } }); expect(wrapper.classes().join(" ")).toMatch(/zinc/); }); it("can disable uppercase formatting", () => { const wrapper = mount(KindBadge, { props: { uppercase: false }, slots: { default: "n" }, }); expect(wrapper.classes().join(" ")).not.toMatch(/uppercase/); }); });