Skip to content

Commit 1116294

Browse files
committed
Add more checks in tests
1 parent a0e0e0c commit 1116294

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

packages/ra-ui-materialui/src/input/AutocompleteArrayInput.spec.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -820,6 +820,9 @@ describe('<AutocompleteArrayInput />', () => {
820820
)) as HTMLInputElement;
821821
// Enter an unknown value and submit it with Enter
822822
await userEvent.type(input, 'New Value{Enter}');
823+
// AutocompleteArrayInput does not have an input with all values.
824+
// Instead it adds buttons for each values.
825+
await screen.findByText('New Value', { selector: '[role=button] *' });
823826
// Clear the input, otherwise the new value won't be shown in the dropdown as it is selected
824827
fireEvent.change(input, {
825828
target: { value: '' },

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1345,6 +1345,7 @@ describe('<AutocompleteInput />', () => {
13451345
)) as HTMLInputElement;
13461346
// Enter an unknown value and submit it with Enter
13471347
await userEvent.type(input, 'New Value{Enter}');
1348+
await screen.getByDisplayValue('New Value');
13481349
// Clear the input, otherwise the new value won't be shown in the dropdown as it is selected
13491350
fireEvent.change(input, {
13501351
target: { value: '' },

0 commit comments

Comments
 (0)