Skip to content
Snippets Groups Projects
user-items.spec.js 814 B
Newer Older
henrikburmann's avatar
henrikburmann committed
import { mount } from "@vue/test-utils";
import UserItems from "@/components/UserProfileComponents/UserItems.vue";

describe("UserItems component", () => {
  let wrapper;

  beforeEach(() => {
    wrapper = mount(UserItems, {
      data() {
        return {
          items: [
            {
              listingID: 1,
              img: "",
              address: "Veien",
              title: "Matboks",
              pricePerDay: 50,
              toggle: false,
            },
          ],
        };
      },
henrikburmann's avatar
henrikburmann committed
    });
henrikburmann's avatar
henrikburmann committed

  it("renders correctly", () => {
    expect(wrapper.element).toMatchSnapshot();
  });
henrikburmann's avatar
henrikburmann committed

  it("is instantiated", () => {
    expect(wrapper.exists()).toBeTruthy();
  });
henrikburmann's avatar
henrikburmann committed

  it("Check headline", () => {
    expect(wrapper.find("#headline").text()).toMatch("Mine gjenstander");
  });
henrikburmann's avatar
henrikburmann committed
});