File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -656,4 +656,20 @@ describe('Tabs', () => {
656
656
expect ( initialWidth ) . to . be . greaterThan ( shorterWidth ) ;
657
657
expect ( longerWidth ) . to . be . greaterThan ( shorterWidth ) ;
658
658
} ) ;
659
+ it ( 'clicks on #list do not throw' , async ( ) => {
660
+ const tabs = await createTabs ( ) ;
661
+ const tabList = ( tabs . shadowRoot as ShadowRoot ) . querySelector (
662
+ '#list'
663
+ ) as HTMLDivElement ;
664
+ // exceptions thrown in event listeners do not propagate to caller
665
+ // we must catch them with window.onerror
666
+ let hasError = false ;
667
+ const oldOnerror = window . onerror ;
668
+ window . onerror = ( ) => {
669
+ hasError = true ;
670
+ } ;
671
+ tabList . dispatchEvent ( new MouseEvent ( 'click' ) ) ;
672
+ expect ( hasError , 'it should not error' ) . to . be . false ;
673
+ window . onerror = oldOnerror ;
674
+ } ) ;
659
675
} ) ;
You can’t perform that action at this time.
0 commit comments