zhouhongshuo ca9430f82c 初始化
2024-08-25 23:46:05 +08:00

38 lines
938 B
TypeScript

import messages from "@intlify/unplugin-vue-i18n/messages";
import { VueQueryPlugin } from "@tanstack/vue-query";
import { mount } from "@vue/test-utils";
import { createPinia, setActivePinia } from "pinia";
import { beforeEach, describe, expect, it } from "vitest";
import { createI18n } from "vue-i18n";
import PostSettingModal from "../PostSettingModal.vue";
describe("PostSettingModal", () => {
beforeEach(() => {
setActivePinia(createPinia());
});
it("should render", () => {
const wrapper = mount(
{
components: {
PostSettingModal,
},
template: `<PostSettingModal></PostSettingModal>`,
},
{
global: {
plugins: [
VueQueryPlugin,
createI18n({
legacy: false,
locale: "en",
messages,
}),
],
},
}
);
expect(wrapper).toBeDefined();
});
});