import { StoreOptions } from "vuex" ; import Router from "vue-router" ; import deepmerge from "deepmerge" ; import { render as originalRender } from "@testing-library/vue" ; import { DeepPartial } from "@/types" ; import { RootState , storeOptions } from "@/state/store" ; export const render = < P extends Record < string , unknown > > ( component , props = { } as P , customStore = { } ) => originalRender ( component , { props , store : deepmerge ( storeOptions , customStore ) , [ "router" as any ] : new Router ( ) , } ) ; export const mockLocaleStorage = ( mock ) => { for ( const key in mock ) { if ( mock . hasOwnProperty ( key ) ) { localStorage . __STORE__ [ key ] = mock [ key ] ; } } } ;