Files
MeshChatX/tests/frontend/FormSubLabel.test.js
Sudo-Ivan 21450c69eb Add AppPropagationSync tests and enhance ConfirmDialog tests
- Introduced a new test suite for App propagation sync metrics, validating toast notifications for sync status.
- Enhanced ConfirmDialog tests to verify heading display and button attributes.
- Added additional tests for FormLabel, FormSubLabel, LanguageSelector, and other components to improve test coverage and ensure proper functionality.
2026-02-14 19:18:37 -06:00

30 lines
937 B
JavaScript

import { mount } from "@vue/test-utils";
import { describe, it, expect } from "vitest";
import FormSubLabel from "@/components/forms/FormSubLabel.vue";
describe("FormSubLabel.vue", () => {
it("renders slot content", () => {
const wrapper = mount(FormSubLabel, {
slots: {
default: "Sub Label Text",
},
});
expect(wrapper.text()).toBe("Sub Label Text");
});
it("has correct classes", () => {
const wrapper = mount(FormSubLabel);
expect(wrapper.classes()).toContain("text-xs");
});
it("uses div as root element", () => {
const wrapper = mount(FormSubLabel, { slots: { default: "Help" } });
expect(wrapper.element.tagName).toBe("DIV");
});
it("renders empty when slot is empty", () => {
const wrapper = mount(FormSubLabel, { slots: { default: "" } });
expect(wrapper.text()).toBe("");
});
});