Skip to content

[Feature]: Support passing Map/Set as props in component testing #36963

@poulet42

Description

@poulet42

🚀 Feature Request

The following is currently not possible:

test('shows all the selected options', async ({ mount }) => {
  const selectedItems = new Set(['orange', 'bananas']);
 
  await mount(<FruitPicker selectedItems={selectedItems} />);
  ...
})

As Set will be serialized to {}.

Could you consider reintroducing #26730 ?

Note; this issue is most likely a duplicate of #24040 but the issue has been closed even tho the linked PR was reverted.

Example

No response

Motivation

Set and Map are valid prop types. This is preventing users from testing components that accept those.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions