32 lines
960 B
JavaScript
32 lines
960 B
JavaScript
// The Lucia project.
|
|
// Copyright 2026-2026 DSP, inc. All rights reserved.
|
|
// Authors:
|
|
// imacat.yang@dsp.im (imacat), 2026/03/05
|
|
|
|
import { describe, it, expect } from "vitest";
|
|
import { mount } from "@vue/test-utils";
|
|
import Badge from "@/components/StatusBadge.vue";
|
|
|
|
describe("Badge", () => {
|
|
it("renders display text", () => {
|
|
const wrapper = mount(Badge, {
|
|
props: { isActivated: true, displayText: "Active" },
|
|
});
|
|
expect(wrapper.text()).toBe("Active");
|
|
});
|
|
|
|
it("has activated class when isActivated is true", () => {
|
|
const wrapper = mount(Badge, {
|
|
props: { isActivated: true, displayText: "Active" },
|
|
});
|
|
expect(wrapper.classes()).toContain("badge-activated");
|
|
});
|
|
|
|
it("has deactivated class when isActivated is false", () => {
|
|
const wrapper = mount(Badge, {
|
|
props: { isActivated: false, displayText: "Inactive" },
|
|
});
|
|
expect(wrapper.classes()).toContain("badge-deactivated");
|
|
});
|
|
});
|