-
Notifications
You must be signed in to change notification settings - Fork 45
#362 - Extend prefer-web-first-assertion #382
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
base: main
Are you sure you want to change the base?
#362 - Extend prefer-web-first-assertion #382
Conversation
This isn't the right approach IMO. This isn't a one-to-one replacement, since the behavior of I think we should add a lint error, but not autofix. |
@mskelton I see your point here. My thought process was connected with the fact that
I tried a simplified approach. Could you please let me know your thoughts? |
0b1c34f
to
1cd4c02
Compare
We can apply an autofix if the autofix is a 1x1 match of behavior, so the example you gave would work. |
I can give it a try, but taking into account how much logic there is in the rule already, I am not sure if it won't complicate things too much. Would this merit a separate rule? Probably unlikely... |
In this PR, I extended the
src/rules/prefer-web-first-assertions.ts
rule to detect another two flaky methods:Additionally, I added handling for
options
argument that is useful, for example, when replacinginnerText()
withtoHaveText()
withuseInnerText
option. Tests for all changes were added.This is a follow-up to #362 .