File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -363,5 +363,32 @@ describe('<hx-tabset> component tests', () => {
363363 expect ( firstTabCount ) . to . equal ( 1 ) ;
364364 expect ( secoundTabCount ) . to . equal ( 2 ) ;
365365 } ) ;
366+
367+ it ( `should be able to navigate between one or more tabs and tab panels` , async ( ) => {
368+ const mockup = `
369+ <hx-tabset>
370+ <hx-tablist>
371+ <hx-tab>First</hx-tab>
372+ <hx-tab>Second</hx-tab>
373+ <hx-tab>Third</hx-tab>
374+ </hx-tablist>
375+ <hx-tabcontent>
376+ <hx-tabpanel>tabpanel-1</hx-tabpanel>
377+ <hx-tabpanel>tabpanel-2</hx-tabpanel>
378+ <hx-tabpanel>tabpanel-3</hx-tabpanel>
379+ </hx-tabcontent>
380+ </hx-tabset>` ;
381+
382+ const fragment = /** @type {HXTabsetElement } */ await fixture ( mockup ) ;
383+
384+ // Selected tab
385+ const selectedTab = fragment . querySelector ( 'hx-tab:nth-child(2)' ) ;
386+
387+ // Data tabpanel
388+ const selectedContent = fragment . querySelector ( 'hx-tabpanel:nth-child(2)' ) ;
389+
390+ expect ( selectedTab ) . to . not . be . null ;
391+ expect ( selectedContent ) . to . not . be . null ;
392+ } ) ;
366393 } ) ;
367394} ) ;
You can’t perform that action at this time.
0 commit comments