Skip to content

Commit

Permalink
Remove stubs in HistoryView component test to make tests work
Browse files Browse the repository at this point in the history
  • Loading branch information
Renni771 committed Jan 18, 2024
1 parent cfee065 commit a94add7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions client/src/components/History/HistoryView.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -65,10 +66,6 @@ async function createWrapper(localVue, currentUserId, history) {
const wrapper = mount(HistoryView, {
propsData: { id: history.id },
localVue,
stubs: {
icon: { template: "<div></div>" },
ContentItem: true,
},
provide: {
store: {
dispatch: jest.fn,
Expand Down Expand Up @@ -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}`);
}
});

Expand Down

0 comments on commit a94add7

Please sign in to comment.