From a94add7ace9c50ac39203441665f0719413b2bf2 Mon Sep 17 00:00:00 2001 From: Rendani Gangazhe Date: Thu, 18 Jan 2024 11:56:59 +0100 Subject: [PATCH] Remove stubs in `HistoryView` component test to make tests work --- client/src/components/History/HistoryView.test.js | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/client/src/components/History/HistoryView.test.js b/client/src/components/History/HistoryView.test.js index 7a0ef49a8fe5..37fa9c79d495 100644 --- a/client/src/components/History/HistoryView.test.js +++ b/client/src/components/History/HistoryView.test.js @@ -8,6 +8,7 @@ import { getHistoryByIdFromServer, setCurrentHistoryOnServer } from "stores/serv import { useUserStore } from "stores/userStore"; import { getLocalVue } from "tests/jest/helpers"; +import ContentItem from "./Content/ContentItem"; import HistoryView from "./HistoryView"; const localVue = getLocalVue(); @@ -65,10 +66,6 @@ async function createWrapper(localVue, currentUserId, history) { const wrapper = mount(HistoryView, { propsData: { id: history.id }, localVue, - stubs: { - icon: { template: "
" }, - ContentItem: true, - }, provide: { store: { dispatch: jest.fn, @@ -121,12 +118,12 @@ describe("History center panel View", () => { expectCorrectLayout(wrapper); // make sure all history items show up - const historyItems = wrapper.findAll("contentitem-stub"); + const historyItems = wrapper.findAllComponents(ContentItem); expect(historyItems.length).toBe(10); for (let i = 0; i < historyItems.length; i++) { const hid = historyItems.length - i; - expect(historyItems.at(i).attributes("id")).toBe(`${hid}`); - expect(historyItems.at(i).attributes("name")).toBe(`Dataset ${hid}`); + expect(historyItems.at(i).props("id")).toBe(hid); + expect(historyItems.at(i).props("name")).toBe(`Dataset ${hid}`); } });