Skip to content

Conversation

jcfilben
Copy link
Collaborator

What does this PR do?

Fixes an issue when the SelectMultiple options array is empty and the app crashes when the drop is opened

Where should the reviewer start?

What testing has been done on this PR?

Tested in storybook and added a jest test

How should this be manually tested?

Do Jest tests follow these best practices?

  • screen is used for querying.
  • The correct query is used. (Refer to this list of queries)
  • userEvent is used in place of fireEvent.
  • asFragment() is used for snapshot testing.

Any background context you want to provide?

What are the relevant issues?

Closes #6893

Screenshots (if appropriate)

Do the grommet docs need to be updated?

no

Should this PR be mentioned in the release notes?

yes

Is this change backwards compatible or is it a breaking change?

backwards compatible

@jcfilben jcfilben requested review from taysea and halocline July 19, 2023 21:45
@@ -456,4 +456,18 @@ describe('SelectMultiple', () => {
screen.queryByRole('option', { name: /Strawberry selected/ }),
).toBeNull();
});

test('empty options', async () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@jcfilben jcfilben merged commit c117b6f into grommet:master Jul 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SelectMultiple - crashes when options array is empty
3 participants