mirror of
https://git.quad4.io/RNS-Things/MeshChatX.git
synced 2026-03-31 16:55:42 +00:00
- 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.
41 lines
1.4 KiB
JavaScript
41 lines
1.4 KiB
JavaScript
import { mount } from "@vue/test-utils";
|
|
import { describe, it, expect } from "vitest";
|
|
import MaterialDesignIcon from "../../meshchatx/src/frontend/components/MaterialDesignIcon.vue";
|
|
|
|
describe("MaterialDesignIcon.vue", () => {
|
|
it("converts icon-name to mdiIconName", () => {
|
|
const wrapper = mount(MaterialDesignIcon, {
|
|
props: { iconName: "account-circle" },
|
|
});
|
|
expect(wrapper.vm.mdiIconName).toBe("mdiAccountCircle");
|
|
});
|
|
|
|
it("renders svg with correct aria-label", () => {
|
|
const wrapper = mount(MaterialDesignIcon, {
|
|
props: { iconName: "home" },
|
|
});
|
|
expect(wrapper.find("svg").attributes("aria-label")).toBe("home");
|
|
});
|
|
|
|
it("falls back to question mark for unknown icons", () => {
|
|
const wrapper = mount(MaterialDesignIcon, {
|
|
props: { iconName: "non-existent-icon" },
|
|
});
|
|
expect(wrapper.vm.iconPath).not.toBe("");
|
|
});
|
|
|
|
it("renders an svg element for valid icon", () => {
|
|
const wrapper = mount(MaterialDesignIcon, {
|
|
props: { iconName: "home" },
|
|
});
|
|
expect(wrapper.find("svg").exists()).toBe(true);
|
|
});
|
|
|
|
it("accepts iconName prop", () => {
|
|
const wrapper = mount(MaterialDesignIcon, {
|
|
props: { iconName: "cog" },
|
|
});
|
|
expect(wrapper.props("iconName")).toBe("cog");
|
|
});
|
|
});
|