From 9d662f5e4903a224bc2474abdb7d2bdb7fc9c839 Mon Sep 17 00:00:00 2001 From: davelopez <46503462+davelopez@users.noreply.github.com> Date: Tue, 28 May 2024 14:30:19 +0200 Subject: [PATCH] Adapt History SelectorModal test --- .../History/Modals/SelectorModal.test.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/client/src/components/History/Modals/SelectorModal.test.js b/client/src/components/History/Modals/SelectorModal.test.js index e6c4e708b1f9..a78afe094f7b 100644 --- a/client/src/components/History/Modals/SelectorModal.test.js +++ b/client/src/components/History/Modals/SelectorModal.test.js @@ -7,6 +7,8 @@ import { createPinia } from "pinia"; import { useHistoryStore } from "stores/historyStore"; import { getLocalVue } from "tests/jest/helpers"; +import { useUserStore } from "@/stores/userStore"; + import SelectorModal from "./SelectorModal"; const localVue = getLocalVue(); @@ -35,6 +37,14 @@ const PROPS_FOR_MODAL_MULTIPLE_SELECT = { const CURRENT_HISTORY_INDICATION_TEXT = "(Current)"; +const CURRENT_USER = { + email: "email", + id: "user_id", + tags_used: [], + isAnonymous: false, + total_disk_usage: 0, +}; + describe("History SelectorModal.vue", () => { let wrapper; let axiosMock; @@ -60,6 +70,10 @@ describe("History SelectorModal.vue", () => { icon: { template: "
" }, }, }); + + const userStore = useUserStore(); + userStore.setCurrentUser(CURRENT_USER); + historyStore = useHistoryStore(); axiosMock = new MockAdapter(axios); getUpdatedAxiosMock();