Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
EmmaLRussell committed Jul 1, 2024
1 parent d005e6f commit 217b3fb
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 20 deletions.
29 changes: 13 additions & 16 deletions app/static/src/app/components/graphConfig/GraphConfig.vue
Original file line number Diff line number Diff line change
@@ -1,19 +1,16 @@
<template>
<div class="graph-config-panel m-2" @drop="onDrop($event)" @dragover.prevent @dragenter.prevent>
<h5>
Graph {{ graphIndex + 1 }}
<button
type="button"
class="btn btn-light mx-2 delete-graph"
v-if="canDelete"
@click="deleteGraph"
v-tooltip="'Delete Graph'"
>
<vue-feather
class="inline-icon clickable ms-2"
type="trash-2"
></vue-feather>
</button>
Graph {{ graphIndex + 1 }}
<button
type="button"
class="btn btn-light mx-2 delete-graph"
v-if="canDelete"
@click="deleteGraph"
v-tooltip="'Delete Graph'"
>
<vue-feather class="inline-icon clickable ms-2" type="trash-2"></vue-feather>
</button>
</h5>
<div class="drop-zone" :class="dragging ? 'drop-zone-active' : 'drop-zone-inactive'">
<template v-for="variable in selectedVariables" :key="variable">
Expand Down Expand Up @@ -42,12 +39,12 @@ import VueFeather from "vue-feather";
import { computed, defineComponent } from "vue";
import { useStore } from "vuex";
import SelectVariables from "../mixins/selectVariables";
import {GraphsMutation} from "../../store/graphs/mutations";
import { GraphsMutation } from "../../store/graphs/mutations";
export default defineComponent({
name: "GraphConfig",
components: {
VueFeather
VueFeather
},
props: {
dragging: {
Expand Down Expand Up @@ -77,7 +74,7 @@ export default defineComponent({
};
const deleteGraph = () => {
store.commit(`graphs/${GraphsMutation.DeleteGraph}`, props.graphIndex);
store.commit(`graphs/${GraphsMutation.DeleteGraph}`, props.graphIndex);
};
return {
Expand Down
5 changes: 3 additions & 2 deletions app/static/tests/e2e/code.etest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ test.describe("Code Tab tests", () => {
expect(await page.locator(":nth-match(.wodin-plot-container, 2)").textContent()).toBe(
"No variables are selected."
);
expect(await page.locator(":nth-match(.graph-config-panel h5, 2)").textContent()).toBe("Graph 2");
expect(await page.locator(":nth-match(.graph-config-panel h5, 2)").textContent()).toContain("Graph 2");
expect(await page.locator(":nth-match(.graph-config-panel .drop-zone, 2)").textContent()).toContain(
"Drag variables here to select them for this graph."
);
Expand All @@ -353,9 +353,10 @@ test.describe("Code Tab tests", () => {
await expect(page.locator(".hidden-variables-panel .variable")).toHaveCount(0);

// Delete second graph
await page.click(":nth-match(.graph-config-panel .delete-graph, 2)")
await page.click(":nth-match(.graph-config-panel .delete-graph, 2)");
await expect(page.locator(".graph-config-panel")).toHaveCount(1);
await expect(page.locator(".graph-config-panel h5")).toHaveText("Graph 1");
await expectGraphVariables(page, 0, ["I", "R"]);

// First graph should not be deletable
await expect(page.locator(".delete-graph")).toHaveCount(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { shallowMount } from "@vue/test-utils";
import { BasicState } from "../../../../src/app/store/basic/state";
import GraphConfig from "../../../../src/app/components/graphConfig/GraphConfig.vue";
import { GraphsAction } from "../../../../src/app/store/graphs/actions";
import {GraphsState} from "../../../../src/app/store/graphs/state";
import {GraphsMutation} from "../../../../src/app/store/graphs/mutations";
import { GraphsState } from "../../../../src/app/store/graphs/state";
import { GraphsMutation } from "../../../../src/app/store/graphs/mutations";

describe("GraphConfig", () => {
const mockUpdateSelectedVariables = jest.fn();
Expand Down

0 comments on commit 217b3fb

Please sign in to comment.