diff --git a/js/src/views/Admin/ProfilesView.vue b/js/src/views/Admin/ProfilesView.vue index f5fff8f3..fa754642 100644 --- a/js/src/views/Admin/ProfilesView.vue +++ b/js/src/views/Admin/ProfilesView.vue @@ -102,7 +102,7 @@ import RouteName from "@/router/name"; import EmptyContent from "@/components/Utils/EmptyContent.vue"; import { useQuery } from "@vue/apollo-composable"; import { useI18n } from "vue-i18n"; -import { computed, ref } from "vue"; +import { computed } from "vue"; import { useHead } from "@vueuse/head"; import { useRouteQuery, diff --git a/js/tests/unit/specs/components/Participation/ParticipationSection.spec.ts b/js/tests/unit/specs/components/Participation/ParticipationSection.spec.ts index 94a59ff4..9588aaf6 100644 --- a/js/tests/unit/specs/components/Participation/ParticipationSection.spec.ts +++ b/js/tests/unit/specs/components/Participation/ParticipationSection.spec.ts @@ -4,7 +4,7 @@ import { createRouter, createWebHistory, Router } from "vue-router"; import { routes } from "@/router"; import { CommentModeration, EventJoinOptions } from "@/types/enums"; import { InMemoryCache } from "@apollo/client/cache"; -import { beforeEach, describe, expect, vi, it } from "vitest"; +import { beforeEach, describe, expect, it } from "vitest"; import Oruga from "@oruga-ui/oruga-next"; import FloatingVue from "floating-vue"; @@ -34,12 +34,7 @@ const eventData = { describe("ParticipationSection", () => { let wrapper: VueWrapper; - const generateWrapper = ( - customProps: Record = {}, - baseData: Record = {} - ) => { - const cache = new InMemoryCache({ addTypename: false }); - + const generateWrapper = (customProps: Record = {}) => { wrapper = mount(ParticipationSection, { stubs: { ParticipationButton: true, diff --git a/js/tests/unit/specs/components/Post/PostListItem.spec.ts b/js/tests/unit/specs/components/Post/PostListItem.spec.ts index bd35d6fa..78fdea58 100644 --- a/js/tests/unit/specs/components/Post/PostListItem.spec.ts +++ b/js/tests/unit/specs/components/Post/PostListItem.spec.ts @@ -1,6 +1,6 @@ -import { config, mount } from "@vue/test-utils"; +import { mount } from "@vue/test-utils"; import PostListItem from "@/components/Post/PostListItem.vue"; -import { vi, beforeEach, describe, it, expect } from "vitest"; +import { beforeEach, describe, it, expect } from "vitest"; import { enUS } from "date-fns/locale"; import { routes } from "@/router"; import { createRouter, createWebHistory, Router } from "vue-router"; diff --git a/js/tests/unit/specs/components/Report/ReportCard.spec.ts b/js/tests/unit/specs/components/Report/ReportCard.spec.ts index cffd1e0d..08ac2e7f 100644 --- a/js/tests/unit/specs/components/Report/ReportCard.spec.ts +++ b/js/tests/unit/specs/components/Report/ReportCard.spec.ts @@ -1,9 +1,7 @@ -import { config, mount } from "@vue/test-utils"; +import { mount } from "@vue/test-utils"; import ReportCard from "@/components/Report/ReportCard.vue"; import { ActorType } from "@/types/enums"; import { describe, expect, it } from "vitest"; -import { createI18n } from "vue-i18n"; -import en from "@/i18n/en_US.json"; const reportData = { id: "1", diff --git a/js/tests/unit/specs/components/User/PasswordReset.spec.ts b/js/tests/unit/specs/components/User/PasswordReset.spec.ts index 697b5e96..7dd17b4f 100644 --- a/js/tests/unit/specs/components/User/PasswordReset.spec.ts +++ b/js/tests/unit/specs/components/User/PasswordReset.spec.ts @@ -1,5 +1,7 @@ const useRouterMock = vi.fn(() => ({ - push: () => {}, + push: function () { + // do nothing + }, })); import { config, mount } from "@vue/test-utils"; diff --git a/js/tests/unit/specs/components/User/login.spec.ts b/js/tests/unit/specs/components/User/login.spec.ts index ed438bb6..e19a58fc 100644 --- a/js/tests/unit/specs/components/User/login.spec.ts +++ b/js/tests/unit/specs/components/User/login.spec.ts @@ -1,8 +1,14 @@ const useRouterMock = vi.fn(() => ({ - push: () => {}, - replace: () => {}, + push: function () { + // do nothing + }, + replace: function () { + // do nothing + }, })); -const useRouteMock = vi.fn(() => {}); +const useRouteMock = vi.fn(function () { + // do nothing +}); import { config, mount, VueWrapper } from "@vue/test-utils"; import Login from "@/views/User/LoginView.vue"; diff --git a/js/tests/unit/specs/components/navbar.spec.ts b/js/tests/unit/specs/components/navbar.spec.ts index 82f65ff7..c2457ae9 100644 --- a/js/tests/unit/specs/components/navbar.spec.ts +++ b/js/tests/unit/specs/components/navbar.spec.ts @@ -1,5 +1,7 @@ const useRouterMock = vi.fn(() => ({ - push: () => {}, + push: function () { + // do nothing + }, })); import { shallowMount, VueWrapper } from "@vue/test-utils"; @@ -21,7 +23,6 @@ vi.mock("vue-router/dist/vue-router.mjs", () => ({ describe("App component", () => { let wrapper: VueWrapper; let mockClient: MockApolloClient | null; - let requestHandlers: Record; const createComponent = (handlers = {}) => { const cache = new InMemoryCache({ addTypename: false }); @@ -31,8 +32,6 @@ describe("App component", () => { resolvers: buildCurrentUserResolver(cache), }); - requestHandlers = { ...handlers }; - wrapper = shallowMount(NavBar, { // stubs: ["router-link", "router-view", "o-dropdown", "o-dropdown-item"], global: {