Skip to content

clearFirst seems to clear all? #49

Description

@antipalindrome

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": "howell.beier@example.com",
    -   },
    - ]
    + 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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions