Skip to content

Commit 341a834

Browse files
committed
test: fix test
1 parent d04df92 commit 341a834

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

src/SelectInput/Content/index.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import * as React from 'react';
2+
import pickAttrs from '@rc-component/util/lib/pickAttrs';
23
import SingleContent from './SingleContent';
34
import MultipleContent from './MultipleContent';
45
import { useSelectInputContext } from '../context';
@@ -10,9 +11,13 @@ export interface SharedContentProps {
1011

1112
const SelectContent = React.forwardRef<HTMLInputElement>(function SelectContent(_, ref) {
1213
const { multiple, onInputKeyDown } = useSelectInputContext();
13-
const { showSearch } = useBaseProps();
14+
const baseProps = useBaseProps();
15+
const { showSearch } = baseProps;
16+
17+
const ariaProps = pickAttrs(baseProps, { aria: true });
1418

1519
const sharedInputProps: SharedContentProps['inputProps'] = {
20+
...ariaProps,
1621
onKeyDown: onInputKeyDown,
1722
readOnly: !showSearch,
1823
};

tests/Accessibility.test.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,10 @@ describe('Select.Accessibility', () => {
6262
expect(onActive).toHaveBeenCalledTimes(1);
6363

6464
keyDown(container.querySelector('input')!, KeyCode.ENTER);
65+
await act(async () => {
66+
jest.runAllTimers();
67+
await Promise.resolve();
68+
});
6569
expectOpen(container, false);
6670

6771
// Next Match

0 commit comments

Comments
 (0)