test case changes

parent b05ae3b7
import { shallowMount } from "@vue/test-utils";
import { jest } from '@jest/globals';
import CategoriesList from "../CategoriesList/CategoriesList.vue";
const product = {
id: 1,
title: "Fjallraven - Foldsack No. 1 Backpack, Fits 15 Laptops",
price: 109.95,
description: "Your perfect pack for everyday use and walks in the forest. Stash your laptop (up to 15 inches) in the padded sleeve, your everyday",
category: "men's clothing",
image: "https://fakestoreapi.com/img/81fPKd-2AYL._AC_SL1500_.jpg",
rating: {
rate: 3.9,
count: 120
}
}
const $store = {
state: {
products: [product]
},
commit: jest.fn()
}
const mockRoute = {
params: {
product: "men's clothing"
}
}
const wrapper = shallowMount(CategoriesList, {
global: {
mocks: {
$store,
$route: mockRoute
}
}
})
describe("Catergory", () => {
it("To check the component redendered or not", () => {
console.log(wrapper.html(),"fsd")
expect(wrapper.contains('product-card-stub')).toBe(true);
expect((wrapper.find('product-card-stub')).attributes('product')).toBe();
})
})
\ No newline at end of file
import { mount } from "@vue/test-utils"
import About from "../About/About.vue";
import Contact from "../Contact/Contact.vue";
describe("notification.vue", () => {
test("sample", () => {
const wrapper = mount(About,);
const wrapper = mount(Contact);
expect(wrapper.text()).toEqual(
"Contact page Loaded"
);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment