style(lint): lint front end test files
Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
parent
759b26e203
commit
98e8546c9a
@ -102,7 +102,7 @@ import RouteName from "@/router/name";
|
|||||||
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
import EmptyContent from "@/components/Utils/EmptyContent.vue";
|
||||||
import { useQuery } from "@vue/apollo-composable";
|
import { useQuery } from "@vue/apollo-composable";
|
||||||
import { useI18n } from "vue-i18n";
|
import { useI18n } from "vue-i18n";
|
||||||
import { computed, ref } from "vue";
|
import { computed } from "vue";
|
||||||
import { useHead } from "@vueuse/head";
|
import { useHead } from "@vueuse/head";
|
||||||
import {
|
import {
|
||||||
useRouteQuery,
|
useRouteQuery,
|
||||||
|
@ -4,7 +4,7 @@ import { createRouter, createWebHistory, Router } from "vue-router";
|
|||||||
import { routes } from "@/router";
|
import { routes } from "@/router";
|
||||||
import { CommentModeration, EventJoinOptions } from "@/types/enums";
|
import { CommentModeration, EventJoinOptions } from "@/types/enums";
|
||||||
import { InMemoryCache } from "@apollo/client/cache";
|
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 Oruga from "@oruga-ui/oruga-next";
|
||||||
import FloatingVue from "floating-vue";
|
import FloatingVue from "floating-vue";
|
||||||
|
|
||||||
@ -34,12 +34,7 @@ const eventData = {
|
|||||||
describe("ParticipationSection", () => {
|
describe("ParticipationSection", () => {
|
||||||
let wrapper: VueWrapper;
|
let wrapper: VueWrapper;
|
||||||
|
|
||||||
const generateWrapper = (
|
const generateWrapper = (customProps: Record<string, unknown> = {}) => {
|
||||||
customProps: Record<string, unknown> = {},
|
|
||||||
baseData: Record<string, unknown> = {}
|
|
||||||
) => {
|
|
||||||
const cache = new InMemoryCache({ addTypename: false });
|
|
||||||
|
|
||||||
wrapper = mount(ParticipationSection, {
|
wrapper = mount(ParticipationSection, {
|
||||||
stubs: {
|
stubs: {
|
||||||
ParticipationButton: true,
|
ParticipationButton: true,
|
||||||
|
@ -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 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 { enUS } from "date-fns/locale";
|
||||||
import { routes } from "@/router";
|
import { routes } from "@/router";
|
||||||
import { createRouter, createWebHistory, Router } from "vue-router";
|
import { createRouter, createWebHistory, Router } from "vue-router";
|
||||||
|
@ -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 ReportCard from "@/components/Report/ReportCard.vue";
|
||||||
import { ActorType } from "@/types/enums";
|
import { ActorType } from "@/types/enums";
|
||||||
import { describe, expect, it } from "vitest";
|
import { describe, expect, it } from "vitest";
|
||||||
import { createI18n } from "vue-i18n";
|
|
||||||
import en from "@/i18n/en_US.json";
|
|
||||||
|
|
||||||
const reportData = {
|
const reportData = {
|
||||||
id: "1",
|
id: "1",
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
const useRouterMock = vi.fn(() => ({
|
const useRouterMock = vi.fn(() => ({
|
||||||
push: () => {},
|
push: function () {
|
||||||
|
// do nothing
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import { config, mount } from "@vue/test-utils";
|
import { config, mount } from "@vue/test-utils";
|
||||||
|
@ -1,8 +1,14 @@
|
|||||||
const useRouterMock = vi.fn(() => ({
|
const useRouterMock = vi.fn(() => ({
|
||||||
push: () => {},
|
push: function () {
|
||||||
replace: () => {},
|
// 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 { config, mount, VueWrapper } from "@vue/test-utils";
|
||||||
import Login from "@/views/User/LoginView.vue";
|
import Login from "@/views/User/LoginView.vue";
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
const useRouterMock = vi.fn(() => ({
|
const useRouterMock = vi.fn(() => ({
|
||||||
push: () => {},
|
push: function () {
|
||||||
|
// do nothing
|
||||||
|
},
|
||||||
}));
|
}));
|
||||||
|
|
||||||
import { shallowMount, VueWrapper } from "@vue/test-utils";
|
import { shallowMount, VueWrapper } from "@vue/test-utils";
|
||||||
@ -21,7 +23,6 @@ vi.mock("vue-router/dist/vue-router.mjs", () => ({
|
|||||||
describe("App component", () => {
|
describe("App component", () => {
|
||||||
let wrapper: VueWrapper;
|
let wrapper: VueWrapper;
|
||||||
let mockClient: MockApolloClient | null;
|
let mockClient: MockApolloClient | null;
|
||||||
let requestHandlers: Record<string, RequestHandler>;
|
|
||||||
|
|
||||||
const createComponent = (handlers = {}) => {
|
const createComponent = (handlers = {}) => {
|
||||||
const cache = new InMemoryCache({ addTypename: false });
|
const cache = new InMemoryCache({ addTypename: false });
|
||||||
@ -31,8 +32,6 @@ describe("App component", () => {
|
|||||||
resolvers: buildCurrentUserResolver(cache),
|
resolvers: buildCurrentUserResolver(cache),
|
||||||
});
|
});
|
||||||
|
|
||||||
requestHandlers = { ...handlers };
|
|
||||||
|
|
||||||
wrapper = shallowMount(NavBar, {
|
wrapper = shallowMount(NavBar, {
|
||||||
// stubs: ["router-link", "router-view", "o-dropdown", "o-dropdown-item"],
|
// stubs: ["router-link", "router-view", "o-dropdown", "o-dropdown-item"],
|
||||||
global: {
|
global: {
|
||||||
|
Loading…
Reference in New Issue
Block a user