react-select-event
react-select-event copied to clipboard
clearFirst seems to clear all?
I'm using aisMulti=true
Creatable
amd writing tests for it.
In my tests I have the following expects:
expect(value).toEqual([emails[0]]); // Passes
await selectEvent.select(getByLabelText("To:"), emails[1].label);
expect(value).toEqual([emails[0], emails[1]]); // Passes
await selectEvent.clearFirst(getByLabelText("To:"));
expect(value).toEqual([emails[1]]); // Fails
Which fails like so:
expect(received).toEqual(expected) // deep equality
- Expected - 6
+ Received + 1
- Array [
- Object {
- "label": "Howell Beier",
- "value": "[email protected]",
- },
- ]
+ Array []
I would expect this to only clear the very first value from the select, rather than all of them. Or am I misunderstanding something?