1+ import { faTh } from "@fortawesome/free-solid-svg-icons" ;
12import { createTestingPinia } from "@pinia/testing" ;
23import { getFakeRegisteredUser } from "@tests/test-data" ;
34import { getLocalVue } from "@tests/vitest/helpers" ;
@@ -7,7 +8,6 @@ import flushPromises from "flush-promises";
78import { PiniaVuePlugin } from "pinia" ;
89import { beforeEach , describe , expect , it , vi } from "vitest" ;
910
10- import { WindowManager } from "@/entry/analysis/window-manager" ;
1111import { useUserStore } from "@/stores/userStore" ;
1212
1313import { loadMastheadWebhooks } from "./_webhooks" ;
@@ -28,7 +28,7 @@ setupMockConfig({});
2828describe ( "Masthead.vue" , ( ) => {
2929 let wrapper ;
3030 let localVue ;
31- let windowManager ;
31+ let windowTab ;
3232 let testPinia ;
3333
3434 function stubLoadWebhooks ( items ) {
@@ -46,8 +46,16 @@ describe("Masthead.vue", () => {
4646 localVue . use ( PiniaVuePlugin ) ;
4747 testPinia = createTestingPinia ( { createSpy : vi . fn } ) ;
4848
49- windowManager = new WindowManager ( { } ) ;
50- const windowTab = windowManager . getTab ( ) ;
49+ windowTab = {
50+ id : "enable-window-manager" ,
51+ icon : faTh ,
52+ tooltip : "Enable/Disable Window Manager" ,
53+ visible : true ,
54+ _active : false ,
55+ onclick : function ( ) {
56+ this . _active = ! this . _active ;
57+ } ,
58+ } ;
5159
5260 const userStore = useUserStore ( ) ;
5361 userStore . currentUser = currentUser ;
@@ -71,9 +79,9 @@ describe("Masthead.vue", () => {
7179
7280 it ( "should display window manager button" , async ( ) => {
7381 expect ( wrapper . find ( "#enable-window-manager a svg" ) . exists ( ) ) . toBe ( true ) ;
74- expect ( windowManager . active ) . toBe ( false ) ;
82+ expect ( windowTab . _active ) . toBe ( false ) ;
7583 await wrapper . find ( "#enable-window-manager a" ) . trigger ( "click" ) ;
76- expect ( windowManager . active ) . toBe ( true ) ;
84+ expect ( windowTab . _active ) . toBe ( true ) ;
7785 } ) ;
7886
7987 it ( "should load webhooks on creation" , async ( ) => {
0 commit comments