import { describe, it, expect } from "vitest"; import { mount } from "@vue/test-utils"; import { Network } from "lucide-vue-next"; import EmptyState from "../EmptyState.vue"; describe("EmptyState", () => { it("renders title + hint + icon", () => { const wrapper = mount(EmptyState, { props: { title: "No resolvers", hint: "Run nwire cache", icon: Network }, }); expect(wrapper.get("[data-testid=empty-state]").text()).toContain("No resolvers"); expect(wrapper.get("[data-testid=empty-state]").text()).toContain("Run nwire cache"); expect(wrapper.findComponent(Network).exists()).toBe(true); }); it("renders without icon + hint", () => { const wrapper = mount(EmptyState, { props: { title: "Empty" } }); expect(wrapper.get("[data-testid=empty-state]").text()).toContain("Empty"); }); it("renders the actions slot", () => { const wrapper = mount(EmptyState, { props: { title: "Empty" }, slots: { actions: '' }, }); expect(wrapper.find("button.btn").exists()).toBe(true); }); });