Skip to content

Commit

Permalink
Merge pull request #17587 from ahmedhamidawan/history_keyboard_nav_bugs
Browse files Browse the repository at this point in the history
[24.0] Fix bugs relating to history keyboard navigation
  • Loading branch information
martenson authored Mar 6, 2024
2 parents 8b44fde + acf340b commit bc78b6f
Show file tree
Hide file tree
Showing 10 changed files with 429 additions and 282 deletions.
24 changes: 17 additions & 7 deletions client/src/components/History/Content/ContentItem.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import { PiniaVuePlugin } from "pinia";
import { getLocalVue } from "tests/jest/helpers";
import VueRouter from "vue-router";

import { mockFetcher } from "@/api/schema/__mocks__";

import ContentItem from "./ContentItem";

jest.mock("components/History/model/queries");
Expand All @@ -14,23 +16,31 @@ localVue.use(VueRouter);
localVue.use(PiniaVuePlugin);
const router = new VueRouter();

jest.mock("vue-router/composables", () => ({
useRoute: jest.fn(() => ({})),
useRouter: jest.fn(() => ({})),
}));

// mock queries
updateContentFields.mockImplementation(async () => {});

const item = {
id: "item_id",
some_data: "some_data",
tags: ["tag1", "tag2", "tag3"],
deleted: false,
visible: true,
};

describe("ContentItem", () => {
let wrapper;

beforeEach(() => {
mockFetcher.path("/api/datasets/{dataset_id}").method("get").mock({ data: item });
wrapper = mount(ContentItem, {
propsData: {
expandDataset: true,
item: {
id: "item_id",
some_data: "some_data",
tags: ["tag1", "tag2", "tag3"],
deleted: false,
visible: true,
},
item,
id: 1,
isDataset: true,
isHistoryItem: true,
Expand Down
Loading

0 comments on commit bc78b6f

Please sign in to comment.