Skip to content

Commit dcd5c1a

Browse files
committed
test: add auto-select creation story
1 parent 27d5bd7 commit dcd5c1a

2 files changed

Lines changed: 8 additions & 1 deletion

File tree

‎packages/ra-ui-materialui/src/input/AutocompleteInput.spec.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ import {
2626
InsideReferenceInputOnChange,
2727
WithInputProps,
2828
OnCreate,
29+
OnCreateWithAutoSelect,
2930
OnCreateSlow,
3031
CreateLabel,
3132
CreateItemLabel,
@@ -1213,7 +1214,7 @@ describe('<AutocompleteInput />', () => {
12131214

12141215
describe('onCreate', () => {
12151216
it('should keep a clicked choice on blur when autoSelect is enabled', async () => {
1216-
render(<OnCreate autoSelect autoHighlight />);
1217+
render(<OnCreateWithAutoSelect />);
12171218
const input = (await screen.findByLabelText(
12181219
'Author'
12191220
)) as HTMLInputElement;

‎packages/ra-ui-materialui/src/input/AutocompleteInput.stories.tsx‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,12 @@ OnCreate.argTypes = {
375375
},
376376
};
377377

378+
export const OnCreateWithAutoSelect = () => (
379+
<Wrapper>
380+
<OnCreateInput autoSelect autoHighlight />
381+
</Wrapper>
382+
);
383+
378384
const AutocompleteWithCreateInReferenceInput = () => {
379385
const [create] = useCreate();
380386
const handleCreateAuthor = async (authorName?: string) => {

0 commit comments

Comments
 (0)