import { describe, it, expect } from "vitest";
import { mount } from "@vue/test-utils";
import DeviceConnectionBadge from "../DeviceConnectionBadge.vue";

describe("DeviceConnectionBadge", () => {
  it("maps active status to success variant", () => {
    const wrapper = mount(DeviceConnectionBadge, {
      props: { status: "active" },
    });

    expect(wrapper.text()).toBe("active");
  });

  it("maps lost status to danger variant", () => {
    const wrapper = mount(DeviceConnectionBadge, {
      props: { status: "lost" },
    });

    expect(wrapper.text()).toBe("lost");
  });

  it("maps unknown status to secondary variant", () => {
    const wrapper = mount(DeviceConnectionBadge, {
      props: { status: "unknown" },
    });

    expect(wrapper.text()).toBe("unknown");
  });

  it("falls back to unknown for empty status", () => {
    const wrapper = mount(DeviceConnectionBadge, {
      props: { status: "" },
    });

    expect(wrapper.text()).toBe("unknown");
  });
});
