Skip to content
Snippets Groups Projects
Commit 33da2593 authored by Zara Mudassar's avatar Zara Mudassar
Browse files

ItemCard converted from vuetify to tailwind and tests for ItemCard added

parent 4b716232
No related branches found
No related tags found
2 merge requests!19Item card,!17Item card
Pipeline #175630 passed
<template> <template>
<v-card max-width="40%" class="text-left ma-5 pa-2"> <div class="flex justify-center mt-5">
<v-img <div class="w-2/5 rounded overflow-hidden bg-gray-100">
class="rounded-5" <img
:src="item.img || require('../assets/default-product.png')" class="w-full"
></v-img> :src="item.img || require('../assets/default-product.png')"
alt="Item image"
<v-card-subtitle>{{ item.adresse }}</v-card-subtitle> />
<div class="p-1 m-1">
<v-card-text class="font-weight-bold mb-n3 mt-n3"> <p class="text-gray-700 text-xs" id="adress">
{{ item.title }} {{ item.adresse }}
</v-card-text> </p>
<p class="font-bold text-sm" id="title">{{ item.title }}</p>
<v-card-subtitle>{{ item.price }}</v-card-subtitle> <p class="text-gray-700 text-xs" id="price">
</v-card> {{ item.price }}
</p>
</div>
</div>
</div>
</template> </template>
<script> <script>
......
import { shallowMount } from "@vue/test-utils";
import ItemCard from "@/components/ItemCard.vue";
describe("ItemCard elements rendering", () => {
it("renders all paragraphs", async() => {
const wrapper = shallowMount(ItemCard);
await wrapper.setData({
item : {
title : 'Dyson',
adresse: 'Trondheim',
price : '500'
}
})
expect(wrapper.find("#title").text()).toBe("Dyson");
expect(wrapper.find("#adress").text()).toBe("Trondheim");
expect(wrapper.find("#price").text()).toBe("500");
});
});
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment