Skip to content

Commit

Permalink
Basic home tool_id test for sanity checking
Browse files Browse the repository at this point in the history
  • Loading branch information
dannon committed Oct 20, 2023
1 parent 9016805 commit 87d5404
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions client/src/entry/analysis/modules/Home.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import { getLocalVue } from "@tests/jest/helpers";
import { shallowMount } from "@vue/test-utils";

import Home from "./Home.vue";

describe("Home module", () => {
const localVue = getLocalVue(true);
let wrapper;
const mockConfig = {};
const mockQuery = {};

beforeEach(() => {
wrapper = shallowMount(Home, {
propsData: {
config: mockConfig,
query: mockQuery,
},
localVue,
});
});

test("should render CenterFrame by default", () => {
expect(wrapper.find("centerframe-stub").exists()).toBe(true);
});

it("returns correct toolParams when tool_id is set, exercise decoding", async () => {
await wrapper.setProps({ query: { tool_id: "exampleTool+gx1" } });
expect(wrapper.vm.toolParams).toEqual({ tool_id: "exampleTool+gx1", id: "exampleTool+gx1" });
console.debug(decodeURIComponent("exampleTool+gx1"));
});
});

0 comments on commit 87d5404

Please sign in to comment.