Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds support for count option to isVisible assertion #204

Merged
merged 1 commit into from
Nov 26, 2018

Conversation

lukemelia
Copy link
Contributor

  • allows passing { count: N } to isVisible, with similar semantics to how exists supports a count option
  • refactors isNotVisible to be implemented as isVisible({ count: 0 })
  • introduce private findElements method to be used similarly to this.findElement
  • refactor to use findElements in exists as well as in isVisible

- allows passing { count: N } to isVisible, with similar semantics to how exists supports a `count` option
- refactors `isNotVisible` to be implemented as `isVisible({ count: 0 })`
- introduce private `findElements` method to be used similarly to `this.findElement`
- refactor to use `findElements` in `exists` as well as in `isVisible`
@lukemelia
Copy link
Contributor Author

BTW, the practical driver for this was working today with a virtual list component where some DOM nodes are kept around with display: none for future reuse, but I have wished for this option in the past in other situations as well.

Copy link
Collaborator

@Turbo87 Turbo87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this looks great, thanks @lukemelia!

@Turbo87 Turbo87 merged commit d0c5e7a into mainmatter:master Nov 26, 2018
@lukemelia lukemelia deleted the feature/is-visible-count branch November 26, 2018 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants