import { config, mount } from "@vue/test-utils"; import GroupSection from "@/components/Group/GroupSection.vue"; import RouteName from "@/router/name"; import { routes } from "@/router"; import { describe, it, expect, beforeEach } from "vitest"; import { createRouter, createWebHistory, Router } from "vue-router"; import Oruga from "@oruga-ui/oruga-next"; config.global.plugins.push(Oruga); let router: Router; beforeEach(async () => { router = createRouter({ history: createWebHistory(), routes: routes, }); // await router.isReady(); }); 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?: { name: string; params: { preferredUsername: string } }; }; const baseProps: Props = { title: "My group section", icon: "bullhorn", route: { name: RouteName.POSTS, params: { preferredUsername: groupUsername, }, }, }; const generateWrapper = (customProps: Props = {}) => { return mount(GroupSection, { props: { ...baseProps, ...customProps }, slots: { default: `