mirror of
https://github.com/PanJiaChen/vue-element-admin.git
synced 2025-08-10 20:39:48 +08:00
* added react testing library dependency * commented out failing tests - no idea since when they are failing * first test * removed testing-library from dependencies - are only going to use test-utils * added tests for Badge component
23 lines
634 B
JavaScript
23 lines
634 B
JavaScript
import { shallowMount } from "@vue/test-utils";
|
|
import SvgIcon from "@/components/SvgIcon/index.vue";
|
|
describe("SvgIcon.vue", () => {
|
|
it("iconClass", () => {
|
|
const wrapper = shallowMount(SvgIcon, {
|
|
propsData: {
|
|
iconClass: "test"
|
|
}
|
|
});
|
|
expect(wrapper.find("use").attributes().href).toBe("#icon-test");
|
|
});
|
|
it("className", () => {
|
|
const wrapper = shallowMount(SvgIcon, {
|
|
propsData: {
|
|
iconClass: "test"
|
|
}
|
|
});
|
|
expect(wrapper.classes().length).toBe(1);
|
|
wrapper.setProps({ className: "test" });
|
|
// expect(wrapper.classes().includes('test')).toBe(true)
|
|
});
|
|
});
|