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

Proposal: Rule for enforcing chained assertions -> assert.dom(selector).hasClass(..).hasAttribute() #396

Open
raido opened this issue Jan 29, 2024 · 0 comments

Comments

@raido
Copy link

raido commented Jan 29, 2024

Hello! What are your thoughts about having a (stylistic) rule which would enforce chaining assertions?

// disallowing duplication like this:
assert.dom("[data-test-my-thing]").exists();
assert.dom("[data-test-my-thing]").hasClass();
assert.dom("[data-test-my-thing]").hasAttribute();

// in favour of:
assert.dom("[data-test-my-thing]")
.exists()
.hasClass()
.hasAttribute();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant