@@ -135,51 +135,71 @@ const hybridViewerStoreMock = {
135135
136136// MOCKS
137137vi . stubGlobal ( "$fetch" , vi . fn ( ) . mockResolvedValue ( { snapshot : snapshotMock } ) )
138- vi . mock ( import ( "../../../internal/utils/viewer_call" , ( ) => ( {
139- viewer_call : viewer_call_mock_fn ,
140- } ) ) )
138+ vi . mock (
139+ import ( "../../../internal/utils/viewer_call" , ( ) => ( {
140+ viewer_call : viewer_call_mock_fn ,
141+ } ) ) ,
142+ )
141143
142- vi . mock ( import ( "@ogw_front/composables/api_fetch" , ( ) => ( {
143- api_fetch : vi . fn ( async ( _req , options = { } ) => {
144- const response = {
145- _data : new Blob ( [ "zipcontent" ] , { type : "application/zip" } ) ,
146- headers : {
147- get : ( k ) => ( k === "new-file-name" ? "project_123.vease" : undefined ) ,
148- } ,
149- }
150- if ( options . response_function ) {
151- await options . response_function ( response )
152- }
153- return response
154- } ) ,
155- } ) ) )
144+ vi . mock (
145+ import ( "@ogw_front/composables/api_fetch" , ( ) => ( {
146+ api_fetch : vi . fn ( async ( _req , options = { } ) => {
147+ const response = {
148+ _data : new Blob ( [ "zipcontent" ] , { type : "application/zip" } ) ,
149+ headers : {
150+ get : ( k ) => ( k === "new-file-name" ? "project_123.vease" : undefined ) ,
151+ } ,
152+ }
153+ if ( options . response_function ) {
154+ await options . response_function ( response )
155+ }
156+ return response
157+ } ) ,
158+ } ) ) ,
159+ )
156160vi . mock ( import ( "js-file-download" , ( ) => ( { default : vi . fn ( ) } ) ) )
157- vi . mock ( import ( "@ogw_front/stores/infra" , ( ) => ( {
158- useInfraStore : ( ) => infraStoreMock ,
159- } ) ) )
160- vi . mock ( import ( "@ogw_front/stores/viewer" , ( ) => ( {
161- useViewerStore : ( ) => viewerStoreMock ,
162- } ) ) )
163- vi . mock ( import ( "@ogw_front/stores/treeview" , ( ) => ( {
164- useTreeviewStore : ( ) => treeviewStoreMock ,
165- } ) ) )
166- vi . mock ( import ( "@ogw_front/stores/data" , ( ) => ( {
167- useDataStore : ( ) => dataStoreMock ,
168- } ) ) )
169- vi . mock ( import ( "@ogw_front/stores/data_style" , ( ) => ( {
170- useDataStyleStore : ( ) => dataStyleStoreMock ,
171- } ) ) )
172- vi . mock ( import ( "@ogw_front/stores/hybrid_viewer" , ( ) => ( {
173- useHybridViewerStore : ( ) => hybridViewerStoreMock ,
174- } ) ) )
175- vi . mock ( import ( "@ogw_front/stores/geode" , ( ) => ( {
176- useGeodeStore : ( ) => geodeStoreMock ,
177- } ) ) )
178- vi . mock ( import ( "@ogw_front/stores/app" , ( ) => ( {
179- useAppStore : ( ) => ( {
180- exportStores : vi . fn ( ( ) => ( { projectName : "mockedProject" } ) ) ,
181- } ) ,
182- } ) ) )
161+ vi . mock (
162+ import ( "@ogw_front/stores/infra" , ( ) => ( {
163+ useInfraStore : ( ) => infraStoreMock ,
164+ } ) ) ,
165+ )
166+ vi . mock (
167+ import ( "@ogw_front/stores/viewer" , ( ) => ( {
168+ useViewerStore : ( ) => viewerStoreMock ,
169+ } ) ) ,
170+ )
171+ vi . mock (
172+ import ( "@ogw_front/stores/treeview" , ( ) => ( {
173+ useTreeviewStore : ( ) => treeviewStoreMock ,
174+ } ) ) ,
175+ )
176+ vi . mock (
177+ import ( "@ogw_front/stores/data" , ( ) => ( {
178+ useDataStore : ( ) => dataStoreMock ,
179+ } ) ) ,
180+ )
181+ vi . mock (
182+ import ( "@ogw_front/stores/data_style" , ( ) => ( {
183+ useDataStyleStore : ( ) => dataStyleStoreMock ,
184+ } ) ) ,
185+ )
186+ vi . mock (
187+ import ( "@ogw_front/stores/hybrid_viewer" , ( ) => ( {
188+ useHybridViewerStore : ( ) => hybridViewerStoreMock ,
189+ } ) ) ,
190+ )
191+ vi . mock (
192+ import ( "@ogw_front/stores/geode" , ( ) => ( {
193+ useGeodeStore : ( ) => geodeStoreMock ,
194+ } ) ) ,
195+ )
196+ vi . mock (
197+ import ( "@ogw_front/stores/app" , ( ) => ( {
198+ useAppStore : ( ) => ( {
199+ exportStores : vi . fn ( ( ) => ( { projectName : "mockedProject" } ) ) ,
200+ } ) ,
201+ } ) ) ,
202+ )
183203
184204vi . stubGlobal ( "useAppStore" , ( ) => ( {
185205 exportStores : vi . fn ( ( ) => ( { projectName : "mockedProject" } ) ) ,
0 commit comments