@@ -77,15 +77,20 @@ vi.mock("@/composables/api_fetch.js", () => ({
7777 api_fetch : vi . fn ( async ( _req , options = { } ) => {
7878 const response = {
7979 _data : new Blob ( [ "zipcontent" ] , { type : "application/zip" } ) ,
80- headers : { get : ( k ) => ( k === "new-file-name" ? "project_123.zip" : null ) } ,
80+ headers : {
81+ get : ( k ) => ( k === "new-file-name" ? "project_123.zip" : null ) ,
82+ } ,
8183 }
8284 if ( options . response_function ) {
8385 await options . response_function ( response )
8486 }
8587 return response
8688 } ) ,
8789} ) )
88- vi . stubGlobal ( "$fetch" , vi . fn ( async ( ) => ( { snapshot : { } } ) ) )
90+ vi . stubGlobal (
91+ "$fetch" ,
92+ vi . fn ( async ( ) => ( { snapshot : { } } ) ) ,
93+ )
8994vi . stubGlobal ( "useDataBaseStore" , ( ) => ( { items : { } } ) )
9095
9196// Mock du store base de données pour éviter Object.entries(undefined)
@@ -108,7 +113,9 @@ describe("ProjectManager composable", () => {
108113 test ( "importProjectFile loads snapshot" , async ( ) => {
109114 const { importProjectFile } = useProjectManager ( )
110115
111- const file = new Blob ( [ '{"dataBase":{"db":{}}}' ] , { type : "application/json" } )
116+ const file = new Blob ( [ '{"dataBase":{"db":{}}}' ] , {
117+ type : "application/json" ,
118+ } )
112119 await importProjectFile ( file )
113120
114121 const infra_store = useInfraStore ( )
0 commit comments