From 87d54040e46abd1f9f715c60c780ca284e3b2b8b Mon Sep 17 00:00:00 2001 From: Dannon Baker Date: Fri, 20 Oct 2023 09:59:21 -0400 Subject: [PATCH] Basic home tool_id test for sanity checking --- .../src/entry/analysis/modules/Home.test.js | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 client/src/entry/analysis/modules/Home.test.js diff --git a/client/src/entry/analysis/modules/Home.test.js b/client/src/entry/analysis/modules/Home.test.js new file mode 100644 index 000000000000..3754f0e9ab09 --- /dev/null +++ b/client/src/entry/analysis/modules/Home.test.js @@ -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")); + }); +});