import { shallowMount } from "@vue/test-utils"
import PostShow from "@/components/post/Show.vue"
describe("PostShow component", () => {
let wrapper;
beforeEach(() => {
wrapper = shallowMount(PostShow, {
propsData: {
post: {
id: 1,
title: "AAA",
body: "aaa"
}
}
});
});
it("has the expected html structure", () => {
expect(wrapper.element).toMatchSnapshot();
});
it("has the expected text", () => {
expect(wrapper.text()).toBe('AAA aaa');
});
});
1PTU4IPXWVFͷςετ
exports[`PostShow component
has the expected html
structure 1`] = `
`;
ͱͱ߹ͬͨεφοϓγϣοτͱ৽ͨʹੜ͞Εͨ
εφοϓγϣοτ͕Ұக͢Δ͔Λςετ͍ͯ͠Δ