Skip to content

feature: implement toBeVisible Jest matcher #1458

Closed
@mdjastrzebski

Description

@mdjastrzebski

Describe the Feature

toBeVisible is a Jest DOM matcher that asserts the visibility of given element by inspecting various CSS styles and other semantic attributes that might make element invisible.

Adapting it to our case it would assert the value in TextInput host elements, to match given value.

Possible Implementations

Proposed API:

export function toBeVisible(
  this: jest.MatcherContext,
  element: ReactTestInstance
)

The matcher should:

  1. Validate that it is invoked on host element
  2. Check visibility status of given element and all of it's ancestors

Each matcher should have a fairly comprehensive test suite.

Open Questions:

  • should this matcher take into account accessibility props? Consider use cases and pros and cons,

Links

Related Issues

#1454

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions