diff --git a/app/static/src/app/components/code/SelectedVariables.vue b/app/static/src/app/components/code/SelectedVariables.vue index 0e863c4f..b07101cd 100644 --- a/app/static/src/app/components/code/SelectedVariables.vue +++ b/app/static/src/app/components/code/SelectedVariables.vue @@ -38,7 +38,8 @@ export default defineComponent({ }; const updateSelectedVariables = (newVariables: string[]) => { - store.dispatch(`graphs/${GraphsAction.UpdateSelectedVariables}`, {index: 0, selectedVariables: newVariables}); + store.dispatch(`graphs/${GraphsAction.UpdateSelectedVariables}`, + {index: 0, selectedVariables: newVariables}); }; const toggleVariable = (variable: string) => { diff --git a/app/static/src/app/store/graphs/actions.ts b/app/static/src/app/store/graphs/actions.ts index 435b8ae2..ea401578 100644 --- a/app/static/src/app/store/graphs/actions.ts +++ b/app/static/src/app/store/graphs/actions.ts @@ -1,8 +1,8 @@ +import { ActionTree } from "vuex"; import { GraphsMutation } from "./mutations"; import { AppState, AppType } from "../appState/state"; import { FitDataAction } from "../fitData/actions"; import { GraphsState } from "./state"; -import { ActionTree } from "vuex"; export enum GraphsAction { UpdateSelectedVariables = "UpdateSelectedVariables" diff --git a/app/static/src/app/store/graphs/getters.ts b/app/static/src/app/store/graphs/getters.ts index 645f4cdb..c1b25c26 100644 --- a/app/static/src/app/store/graphs/getters.ts +++ b/app/static/src/app/store/graphs/getters.ts @@ -1,5 +1,5 @@ -import {GraphsState} from "./state"; import {Getter, GetterTree} from "vuex"; +import {GraphsState} from "./state"; import {AppState} from "../appState/state"; export enum GraphsGetter { diff --git a/app/static/src/app/store/graphs/mutations.ts b/app/static/src/app/store/graphs/mutations.ts index 48e4208e..e86fc022 100644 --- a/app/static/src/app/store/graphs/mutations.ts +++ b/app/static/src/app/store/graphs/mutations.ts @@ -1,6 +1,5 @@ import { MutationTree } from "vuex"; import { YAxisRange, GraphsState } from "./state"; -import { ModelState } from "../model/state"; export enum GraphsMutation { SetLogScaleYAxis = "SetLogScaleYAxis", diff --git a/app/static/tests/unit/components/code/selectedVariables.test.ts b/app/static/tests/unit/components/code/selectedVariables.test.ts index 2fb1dd69..462fd647 100644 --- a/app/static/tests/unit/components/code/selectedVariables.test.ts +++ b/app/static/tests/unit/components/code/selectedVariables.test.ts @@ -81,14 +81,16 @@ describe("SelectedVariables", () => { const i = wrapper.findAll(".selected-variables-panel span.variable").at(1)!; await i.trigger("click"); expect(mockUpdateSelectedVariables).toBeCalledTimes(1); - expect(mockUpdateSelectedVariables.mock.calls[0][1]).toStrictEqual({index: 0, selectedVariables: ["S", "R", "I"]}); + expect(mockUpdateSelectedVariables.mock.calls[0][1]).toStrictEqual( + {index: 0, selectedVariables: ["S", "R", "I"]}); }); it("clicking select all link selects all variables", async () => { const wrapper = getWrapper(); wrapper.find("span#select-variables-all").trigger("click"); expect(mockUpdateSelectedVariables).toBeCalledTimes(1); - expect(mockUpdateSelectedVariables.mock.calls[0][1]).toStrictEqual({index: 0, selectedVariables: ["S", "I", "R"]}); + expect(mockUpdateSelectedVariables.mock.calls[0][1]).toStrictEqual( + {index: 0, selectedVariables: ["S", "I", "R"]}); }); it("clicking select none link unselects all variables", async () => { diff --git a/app/static/tests/unit/store/fitData/actions.test.ts b/app/static/tests/unit/store/fitData/actions.test.ts index e255548c..7d5c9df5 100644 --- a/app/static/tests/unit/store/fitData/actions.test.ts +++ b/app/static/tests/unit/store/fitData/actions.test.ts @@ -368,7 +368,8 @@ describe("Fit Data actions", () => { }; const payload = { column: "a", variable: "I" }; - (actions[FitDataAction.UpdateLinkedVariable] as any)({ commit, dispatch, state: testState, rootGetters }, payload); + (actions[FitDataAction.UpdateLinkedVariable] as any)( + { commit, dispatch, state: testState, rootGetters }, payload); expect(commit).toHaveBeenCalledTimes(2); expect(commit.mock.calls[0][0]).toBe(FitDataMutation.SetLinkedVariable); expect(commit.mock.calls[0][1]).toBe(payload); @@ -388,7 +389,8 @@ describe("Fit Data actions", () => { }; const payload = { column: "b", variable: "I" }; - (actions[FitDataAction.UpdateLinkedVariable] as any)({ commit, dispatch, state: testState, rootGetters }, payload); + (actions[FitDataAction.UpdateLinkedVariable] as any)( + { commit, dispatch, state: testState, rootGetters }, payload); expect(commit).toHaveBeenCalledTimes(1); expect(commit.mock.calls[0][0]).toBe(FitDataMutation.SetLinkedVariable); expect(commit.mock.calls[0][1]).toBe(payload); diff --git a/app/static/tests/unit/store/graphs/actions.test.ts b/app/static/tests/unit/store/graphs/actions.test.ts index f113a1f3..b47f3e75 100644 --- a/app/static/tests/unit/store/graphs/actions.test.ts +++ b/app/static/tests/unit/store/graphs/actions.test.ts @@ -38,7 +38,8 @@ describe("Graphs actions", () => { ); expect(commit).toHaveBeenCalledTimes(1); expect(commit.mock.calls[0][0]).toBe(GraphsMutation.SetSelectedVariables); - expect(commit.mock.calls[0][1]).toStrictEqual({index: 1, selectedVariables: ["a", "b"], unselectedVariables: ["c"]}); + expect(commit.mock.calls[0][1]).toStrictEqual( + {index: 1, selectedVariables: ["a", "b"], unselectedVariables: ["c"]}); expect(dispatch).not.toHaveBeenCalled(); }); @@ -61,7 +62,8 @@ describe("Graphs actions", () => { ); expect(commit).toHaveBeenCalledTimes(1); expect(commit.mock.calls[0][0]).toBe(GraphsMutation.SetSelectedVariables); - expect(commit.mock.calls[0][1]).toStrictEqual({index: 1, selectedVariables: ["a", "b"], unselectedVariables: ["c"]}); + expect(commit.mock.calls[0][1]).toStrictEqual( + {index: 1, selectedVariables: ["a", "b"], unselectedVariables: ["c"]}); expect(dispatch).toHaveBeenCalledTimes(1); expect(dispatch.mock.calls[0][0]).toBe(`fitData/${FitDataAction.UpdateLinkedVariables}`); expect(dispatch.mock.calls[0][1]).toBe(null); diff --git a/app/static/tests/unit/store/graphs/mutations.test.ts b/app/static/tests/unit/store/graphs/mutations.test.ts index 558cad90..d6a8e6ab 100644 --- a/app/static/tests/unit/store/graphs/mutations.test.ts +++ b/app/static/tests/unit/store/graphs/mutations.test.ts @@ -33,7 +33,8 @@ describe("Graphs mutations", () => { { selectedVariables: [], unselectedVariables: [] } ] }); - mutations.SetSelectedVariables(testState, {index: 1, selectedVariables: ["x", "z"], unselectedVariables: ["y"]}); + mutations.SetSelectedVariables(testState, + {index: 1, selectedVariables: ["x", "z"], unselectedVariables: ["y"]}); expect(testState.config[1]).toStrictEqual({selectedVariables: ["x", "z"], unselectedVariables: ["y"]}); expect(testState.config[0]).toStrictEqual({ selectedVariables: [], unselectedVariables: [] }); });