Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
scurker committed Oct 2, 2024
1 parent c424eda commit be8b928
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@ test('should set focus to custom element when opened', () => {
data-testid="bottomsheet"
focusOptions={{ initialFocus: ref.current as HTMLElement }}
>
<button>no focus me</button>
<button ref={ref}>focus me</button>
</BottomSheet>
);
Expand All @@ -146,6 +147,7 @@ test('should set focus to custom element when opened', () => {
focusOptions={{ initialFocus: ref.current as HTMLElement }}
open
>
<button>no focus me</button>
<button ref={ref}>focus me</button>
</BottomSheet>
);
Expand All @@ -161,6 +163,7 @@ test('should set focus to custom ref element', () => {
data-testid="bottomsheet"
focusOptions={{ initialFocus: ref }}
>
<button>no focus me</button>
<button ref={ref}>focus me</button>
</BottomSheet>
);
Expand All @@ -172,6 +175,7 @@ test('should set focus to custom ref element', () => {
focusOptions={{ initialFocus: ref }}
open
>
<button>no focus me</button>
<button ref={ref}>focus me</button>
</BottomSheet>
);
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/components/BottomSheet/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ const BottomSheet = forwardRef<HTMLDivElement, BottomSheetProps>(
const [labelId] = useId(1, 'bottom-sheet-label');

const handleClose = useCallback(() => {
// istanbul ignore else
if (typeof onClose === 'function') {
onClose();
}
Expand Down

0 comments on commit be8b928

Please sign in to comment.