import { config, createLocalVue, mount } from "@vue/test-utils"; import GroupSection from "@/components/Group/GroupSection.vue"; import Buefy from "buefy"; import VueRouter, { Location } from "vue-router"; import RouteName from "@/router/name"; import { routes } from "@/router"; const localVue = createLocalVue(); localVue.use(Buefy); config.mocks.$t = (key: string): string => key; localVue.use(VueRouter); const router = new VueRouter({ routes, mode: "history" }); const groupPreferredUsername = "my_group"; const groupDomain = "remotedomain.net"; const groupUsername = `${groupPreferredUsername}@${groupDomain}`; const defaultSlotText = "A list of elements"; const createSlotButtonText = "+ Create a post"; type Props = { title?: string; icon?: string; privateSection?: boolean; route?: Location; }; const baseProps: Props = { title: "My group section", icon: "bullhorn", route: { name: RouteName.POSTS, params: { preferredUsername: groupUsername, }, }, }; const generateWrapper = (customProps: Props = {}) => { return mount(GroupSection, { localVue, router, propsData: { ...baseProps, ...customProps }, slots: { default: `