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

item card related files deleted, now this branch only includes adding new item related files

parent f5467460
No related branches found
No related tags found
2 merge requests!19Item card,!17Item card
Pipeline #176186 passed
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
<label <label
class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300" class="block mb-2 text-sm font-medium text-gray-900 dark:text-gray-300"
id="titleLabel" id="titleLabel"
>Tittel</label> >Tittel</label
>
<input <input
type="text" type="text"
id="title" id="title"
......
...@@ -27,11 +27,6 @@ const routes = [ ...@@ -27,11 +27,6 @@ const routes = [
name: "addNewItem", name: "addNewItem",
component: () => import("../views/AddNewItemView.vue"), component: () => import("../views/AddNewItemView.vue"),
}, },
{
path: "/itemCard",
name: "itemCard",
component: () => import("../views/ItemCardView.vue"),
},
]; ];
const router = createRouter({ const router = createRouter({
......
...@@ -2,37 +2,35 @@ import { shallowMount } from "@vue/test-utils"; ...@@ -2,37 +2,35 @@ import { shallowMount } from "@vue/test-utils";
import AddNewItem from "@/components/AddNewItem.vue"; import AddNewItem from "@/components/AddNewItem.vue";
describe("addNewItem elements rendering", () => { describe("addNewItem elements rendering", () => {
it("renders all labels", () => {
it("renders all labels", () => { const wrapper = shallowMount(AddNewItem);
const wrapper = shallowMount(AddNewItem); expect(wrapper.find("#titleLabel").text()).toMatch("Tittel");
expect(wrapper.find("#selectCategoryLabel").text()).toMatch("Kategori");
expect(wrapper.find('#titleLabel').text()).toMatch("Tittel"); expect(wrapper.find("#priceLabel").text()).toMatch("Pris");
expect(wrapper.find('#selectCategoryLabel').text()).toMatch("Kategori"); expect(wrapper.find("#descriptionLabel").text()).toMatch("Beskrivelse");
expect(wrapper.find('#priceLabel').text()).toMatch("Pris"); expect(wrapper.find("#imageLabel").text()).toMatch("Bilde");
expect(wrapper.find('#descriptionLabel').text()).toMatch("Beskrivelse"); });
expect(wrapper.find('#imageLabel').text()).toMatch("Bilde");
it("Tests setting values of input field", async () => {
}); const wrapper = shallowMount(AddNewItem);
it("Tests setting values of input field", async() => { const titleInput = wrapper.find("#title");
await titleInput.setValue("Dyson");
const wrapper = shallowMount(AddNewItem); expect(titleInput.element.value).toBe("Dyson");
const titleInput = wrapper.find('#title'); const selectedCategory = wrapper.find("#categories");
await titleInput.setValue("Dyson"); await selectedCategory.setValue("Hage");
expect(titleInput.element.value).toBe("Dyson"); expect(selectedCategory.element.value).toBe("Hage");
const selectedCategory = wrapper.find('#categories'); const priceInput = wrapper.find("#price");
await selectedCategory.setValue("Hage"); await priceInput.setValue(500);
expect(selectedCategory.element.value).toBe("Hage"); expect(priceInput.element.value).toBe("500");
const priceInput = wrapper.find('#price'); const descriptionInput = wrapper.find("#description");
await priceInput.setValue(500); await descriptionInput.setValue("Dette er en støvsuer fra Dyson");
expect(priceInput.element.value).toBe("500"); expect(descriptionInput.element.value).toBe(
"Dette er en støvsuer fra Dyson"
const descriptionInput = wrapper.find('#description'); );
await descriptionInput.setValue("Dette er en støvsuer fra Dyson"); });
expect(descriptionInput.element.value).toBe("Dette er en støvsuer fra Dyson");
});
}); });
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