@@ -359,17 +359,22 @@ describe("attachWidgetBridge parent-brokered pub/sub", () => {
359359 const filter = connected ( { id : "filter" , tabSlug : "a" , bus } ) ;
360360 const chart = connected ( { id : "chart" , tabSlug : "a" , bus } ) ;
361361 const otherTab = connected ( { id : "other" , tabSlug : "b" , bus } ) ;
362- chart . childPort . postMessage ( { v : 1 , type : "workspace:subscribe" , channel : "selection" } ) ;
363- otherTab . childPort . postMessage ( { v : 1 , type : "workspace:subscribe" , channel : "selection" } ) ;
362+ chart . childPort . postMessage ( { v : 1 , type : "workspace:subscribe" , channel : "selection" } , [ ] ) ;
363+ otherTab . childPort . postMessage ( { v : 1 , type : "workspace:subscribe" , channel : "selection" } , [ ] ) ;
364364 // MessagePorts are ordered individually, not across distinct ports. Let both
365365 // subscriptions reach the parent before publishing from the third port.
366- await new Promise ( ( resolve ) => setTimeout ( resolve , 0 ) ) ;
367- filter . childPort . postMessage ( {
368- v : 1 ,
369- type : "workspace:publish" ,
370- channel : "selection" ,
371- payload : { region : "eu" } ,
366+ await new Promise < void > ( ( resolve ) => {
367+ setTimeout ( resolve , 0 ) ;
372368 } ) ;
369+ filter . childPort . postMessage (
370+ {
371+ v : 1 ,
372+ type : "workspace:publish" ,
373+ channel : "selection" ,
374+ payload : { region : "eu" } ,
375+ } ,
376+ [ ] ,
377+ ) ;
373378
374379 await vi . waitFor ( ( ) => expect ( chart . posts ) . toHaveLength ( 1 ) ) ;
375380 expect ( chart . posts [ 0 ] ) . toEqual ( {
@@ -391,19 +396,26 @@ describe("attachWidgetBridge parent-brokered pub/sub", () => {
391396 const bus = createWorkspaceWidgetBus ( ) ;
392397 const publisher = connected ( { id : "publisher" , tabSlug : "removed" , bus } ) ;
393398 const subscriber = connected ( { id : "subscriber" , tabSlug : "removed" , bus } ) ;
394- subscriber . childPort . postMessage ( { v : 1 , type : "workspace:subscribe" , channel : "updates" } ) ;
395- await new Promise ( ( resolve ) => setTimeout ( resolve , 0 ) ) ;
399+ subscriber . childPort . postMessage ( { v : 1 , type : "workspace:subscribe" , channel : "updates" } , [ ] ) ;
400+ await new Promise < void > ( ( resolve ) => {
401+ setTimeout ( resolve , 0 ) ;
402+ } ) ;
396403
397404 subscriber . detach ( ) ;
398- publisher . childPort . postMessage ( {
399- v : 1 ,
400- type : "workspace:publish" ,
401- channel : "updates" ,
402- payload : 1 ,
403- } ) ;
405+ publisher . childPort . postMessage (
406+ {
407+ v : 1 ,
408+ type : "workspace:publish" ,
409+ channel : "updates" ,
410+ payload : 1 ,
411+ } ,
412+ [ ] ,
413+ ) ;
404414 bus . retainTabs ( new Set ( ) ) ;
405415 bus . dispose ( ) ;
406- await new Promise ( ( resolve ) => setTimeout ( resolve , 0 ) ) ;
416+ await new Promise < void > ( ( resolve ) => {
417+ setTimeout ( resolve , 0 ) ;
418+ } ) ;
407419
408420 expect ( subscriber . posts ) . toHaveLength ( 0 ) ;
409421 publisher . detach ( ) ;
0 commit comments