Runs in a real DOM. Each test seeds the page with a tab list before calling your function.
The page has three [role="tab"] buttons and three [role="tabpanel"] panels in matching order. The first tab starts selected. Implement activateTab(index) so that the tab at index becomes the only selected tab:
aria-selectedis"true"on that tab and"false"on the others- the
activeclass is on that tab only tabindexis0on that tab and-1on the others (roving tabindex)- every panel except the matching one has the
hiddenattribute
If index is out of range, change nothing. Finally return { tabs, panelsHidden } where tabs is the array of each tab's aria-selected attribute (strings) and panelsHidden is each panel's hidden property (booleans), both read back from the DOM.