Closed
Description
Describe the Feature
toHaveStyle
is a Jest DOM matcher asserting that given element has certain CSS styles.
We also have toHaveStyles
already implemented in Jest Native. So migrating it to current repo, updating code to use RNTL helpers and reviewing TS types + tests quality should be the scope for the task.
Possible Implementations
Proposed API:
export function toHaveStyle(
this: jest.MatcherContext,
element: ReactTestInstance,
style: StyleProp<ViewStyle | TextStyle | ImageStyle>,
) {
The matcher should:
- Validate that it is invoked on a host element
- Check if given element contains all of the passed state entries.
Each matcher should have a fairly comprehensive test suite.