11import { createTestingPinia } from "@pinia/testing" ;
2- import { getLocalVue } from "@tests/vitest/helpers" ;
2+ import { createTestRouter , getLocalVue } from "@tests/vitest/helpers" ;
33import { mount } from "@vue/test-utils" ;
44import { beforeEach , describe , expect , it , vi } from "vitest" ;
55import { nextTick } from "vue" ;
@@ -10,8 +10,6 @@ import { useActivityStore } from "@/stores/activityStore";
1010
1111import mountTarget from "./ActivitySettings.vue" ;
1212
13- const localVue = getLocalVue ( ) ;
14-
1513const { server, http } = useServerMock ( ) ;
1614const activityItemSelector = ".activity-settings-item" ;
1715
@@ -42,6 +40,7 @@ describe("ActivitySettings", () => {
4240
4341 beforeEach ( async ( ) => {
4442 const pinia = createTestingPinia ( { createSpy : vi . fn , stubActions : false } ) ;
43+ const router = createTestRouter ( ) ;
4544 // Mock the response of the API call
4645 server . use (
4746 http . get ( "/api/unprivileged_tools" , ( { params, query, response } ) => {
@@ -50,14 +49,16 @@ describe("ActivitySettings", () => {
5049 ) ;
5150 activityStore = useActivityStore ( undefined ) ;
5251 wrapper = mount ( mountTarget , {
53- localVue,
54- pinia,
52+ global : {
53+ ...getLocalVue ( ) ,
54+ plugins : [ ...( getLocalVue ( ) . plugins || [ ] ) , pinia , router ] ,
55+ stubs : {
56+ FontAwesomeIcon : { template : "<div></div>" } ,
57+ } ,
58+ } ,
5559 props : {
5660 query : "" ,
57- activityBarId : undefined ,
58- } ,
59- stubs : {
60- FontAwesomeIcon : { template : "<div></div>" } ,
61+ activityBarId : "test-activity-bar" ,
6162 } ,
6263 } ) ;
6364 await activityStore . sync ( ) ;
0 commit comments