2020-12-02 11:19:39 +01:00
|
|
|
import { mount } from "@vue/test-utils";
|
2022-09-20 16:53:26 +02:00
|
|
|
import Tag from "@/components/TagElement.vue";
|
2022-07-12 10:55:28 +02:00
|
|
|
import { it, expect } from "vitest";
|
2020-12-02 11:19:39 +01:00
|
|
|
|
|
|
|
const tagContent = "My tag";
|
|
|
|
|
|
|
|
const createComponent = () => {
|
|
|
|
return mount(Tag, {
|
|
|
|
slots: {
|
|
|
|
default: tagContent,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
};
|
|
|
|
|
|
|
|
it("renders a Vue component", () => {
|
|
|
|
const wrapper = createComponent();
|
|
|
|
|
|
|
|
expect(wrapper.exists()).toBe(true);
|
2022-07-12 10:55:28 +02:00
|
|
|
expect(wrapper.find("span").text()).toEqual(tagContent);
|
2020-12-02 11:19:39 +01:00
|
|
|
});
|