Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions src/components/Dropdown/DropdownItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ export function DropdownItemWithIndex(props: DropdownItemProps & { index: number
className={isFocused ? focusedClassName : className}
onClick={handleClick}
aria-label={typeof ariaLabel === 'function' ? ariaLabel(value) : ariaLabel}
role="option"
aria-selected={isFocused}
>
{children}
</a>
Expand Down
2 changes: 1 addition & 1 deletion src/components/Dropdown/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ export function DropdownMenu(
return null;
}

return <div id={dropdownListUUID}>{children}</div>;
return <div id={dropdownListUUID} role="listbox">{children}</div>;
}
2 changes: 1 addition & 1 deletion test-site/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 15 additions & 3 deletions tests/scripts/start-storybook.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ PREEXISTING_PORT_PROCESS=`lsof -i :6006`
if [[ -z $PREEXISTING_PORT_PROCESS ]]
then
echo "port:6006 available - starting storybook"
npm run storybook -- --quiet --ci &
# If setsid is unavailable, Storybook runs in our process group; only kill its PID to avoid terminating the test runner.
if command -v setsid >/dev/null 2>&1; then
STORYBOOK_KILL_MODE="process_group"
SBCONFIG_PORT=6006 STORYBOOK_PORT=6006 PORT=6006 setsid npm run storybook -- --quiet --ci &
else
STORYBOOK_KILL_MODE="pid"
SBCONFIG_PORT=6006 STORYBOOK_PORT=6006 PORT=6006 npm run storybook -- --quiet --ci &
fi
NEW_STORYBOOK_JOB_ID=$(echo $!) #get the background job ID

# wait for a locally served Storybook
Expand All @@ -25,7 +32,12 @@ then
do
if [ ${attempt_counter} -eq ${max_attempts} ]
then
pkill -P $NEW_STORYBOOK_JOB_ID
if [[ "$STORYBOOK_KILL_MODE" == "process_group" ]]
then
kill -TERM -- -"$NEW_STORYBOOK_JOB_ID" 2>/dev/null || true
else
kill "$NEW_STORYBOOK_JOB_ID" 2>/dev/null || true
fi
echo "Max attempts reached"
exit 1
fi
Expand All @@ -37,4 +49,4 @@ then
unset NODE_OPTIONS
else
echo -e "port:6006 in use - storybook already started: \n $PREEXISTING_PORT_PROCESS"
fi
fi
8 changes: 7 additions & 1 deletion tests/scripts/visual-coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,13 @@ test-storybook --coverage
# kill the locally served Storybook started by the test
if [[ -z $PREEXISTING_PORT_PROCESS ]]
then
pkill -g $NEW_STORYBOOK_JOB_ID 2>/dev/null || true
if [[ "$STORYBOOK_KILL_MODE" == "process_group" ]]
then
kill -TERM -- -"$NEW_STORYBOOK_JOB_ID" 2>/dev/null || true
else
kill "$NEW_STORYBOOK_JOB_ID" 2>/dev/null || true
fi
wait "$NEW_STORYBOOK_JOB_ID" 2>/dev/null || true
fi
# generate lcov coverage for visual tests from story book
nyc report --reporter=lcov -t coverage/storybook --report-dir coverage/visual
Expand Down