Skip to content

Support for input:focus pseudo-element selector #1709

Description

@josemigallas

Following up on #703 I would like to request this one, so that it can be checked if an input has focus:

const wrapper = mount('<MyComponent />'); // Suppose this has an input inside.
const input = wrapper.find('input');
expect(input.is(':focus')).toBe(true);

Right now an error is thrown:

Enzyme::Selector does not support pseudo-element or pseudo-class selectors.

I'm using "enzyme": "^3.3.0".

Metadata

Metadata

Assignees

Labels

feature requestIssues asking for stuff that would be semver-minor

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions