@@ -25,9 +25,9 @@ vi.mock('../../../models/app/loader.js')
2525vi . mock ( './app-watcher-esbuild.js' )
2626
2727// Extensions 1 and 1B simulate extensions defined in the same directory (same toml)
28- const extension1 = await testUIExtension ( { type : 'ui_extension' , directory : '/extensions/ui_extension_1' , uid : 'uid1' } )
29- const extension1B = await testUIExtension ( { type : 'ui_extension' , directory : '/extensions/ui_extension_1' , uid : 'uid1B' } )
30- const extension2 = await testUIExtension ( { type : 'ui_extension' , directory : '/extensions/ui_extension_2' , uid : 'uid2' } )
28+ const extension1 = await testUIExtension ( { type : 'ui_extension' , handle : 'h1' , directory : '/extensions/ui_extension_1' , uid : 'uid1' } )
29+ const extension1B = await testUIExtension ( { type : 'ui_extension' , handle : 'h2' , directory : '/extensions/ui_extension_1' , uid : 'uid1B' } )
30+ const extension2 = await testUIExtension ( { type : 'ui_extension' , handle : 'h3' , directory : '/extensions/ui_extension_2' , uid : 'uid2' } )
3131const flowExtension = await testFlowActionExtension ( '/extensions/flow_action' )
3232const posExtension = await testAppConfigExtensions ( )
3333const appAccessExtension = await testAppAccessConfigExtension ( )
@@ -36,12 +36,14 @@ const webhookExtension = await testSingleWebhookSubscriptionExtension()
3636// Simulate updated extensions
3737const extension1Updated = await testUIExtension ( {
3838 type : 'ui_extension' ,
39+ handle : 'h1' ,
3940 name : 'updated_name1' ,
4041 directory : '/extensions/ui_extension_1' ,
4142 uid : 'uid1' ,
4243} )
4344const extension1BUpdated = await testUIExtension ( {
4445 type : 'ui_extension' ,
46+ handle : 'h2' ,
4547 name : 'updated_name1B' ,
4648 directory : '/extensions/ui_extension_1' ,
4749 uid : 'uid1B' ,
@@ -212,6 +214,32 @@ const testCases: TestCase[] = [
212214 { type : EventType . Updated , extension : extension1B , buildResult : { status : 'ok' , uid : 'uid1B' } } ,
213215 ] ,
214216 } ,
217+ {
218+ name : 'file_updated with extensionHandle targets only the specified extension' ,
219+ fileWatchEvent : {
220+ type : 'file_updated' ,
221+ path : '/extensions/ui_extension_1/src/file.js' ,
222+ extensionPath : '/extensions/ui_extension_1' ,
223+ extensionHandle : 'h1' ,
224+ startTime : [ 0 , 0 ] ,
225+ } ,
226+ initialExtensions : [ extension1 , extension1B , extension2 , posExtension ] ,
227+ finalExtensions : [ extension1 , extension1B , extension2 , posExtension ] ,
228+ extensionEvents : [ { type : EventType . Updated , extension : extension1 , buildResult : { status : 'ok' , uid : 'uid1' } } ] ,
229+ } ,
230+ {
231+ name : 'file_created with extensionHandle targets only the specified extension' ,
232+ fileWatchEvent : {
233+ type : 'file_created' ,
234+ path : '/extensions/ui_extension_1/src/new-file.js' ,
235+ extensionPath : '/extensions/ui_extension_1' ,
236+ extensionHandle : 'h2' ,
237+ startTime : [ 0 , 0 ] ,
238+ } ,
239+ initialExtensions : [ extension1 , extension1B , extension2 , posExtension ] ,
240+ finalExtensions : [ extension1 , extension1B , extension2 , posExtension ] ,
241+ extensionEvents : [ { type : EventType . Updated , extension : extension1B , buildResult : { status : 'ok' , uid : 'uid1B' } } ] ,
242+ } ,
215243 {
216244 name : 'app config updated with multiple extensions affected' ,
217245 fileWatchEvent : {
0 commit comments