1
0
mirror of https://github.com/PanJiaChen/vue-element-admin.git synced 2025-08-10 20:39:48 +08:00
Sofia Calderon 8b0a1d10f2
Tests fo badge component (#681)
* 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
2021-03-22 13:35:43 -04:00

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)
});
});