Skip to content

toHaveDisplayValue doesn't support regex #239

@zikaari

Description

@zikaari

expect(userSelect).toHaveDisplayValue(/bezos/i) doesn't work, instead it converts /bezos/i to string and tries to do a literal string match, as seen in the error:

    Expected element to have display value:
      /bezos/i
    Received:
      bezos

I'd like to stick with regex because the way we format HTML, it creates leading and trailing whitespaces, which prevent the match.

	<option>
		{{u.name}}
	</option>

It won't be very pretty to have tests that look like expect(userSelect).toHaveDisplayValue(" bezos "), ugly and error prone.

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