You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
New rule: force waitForElementToBeRemoved when waitFor is used to wait for disappearance #411
enhancementNew feature or requestnew ruleNew rule to be included in the pluginpinnedPinned for different reasons. Issues with this label won't be flagged as stale by stalebot
We could have a new rule that reports waitFor in cases where waitForElementToBeRemoved could be used. Could be named prefer-waiting-for-disappearance or something similar.
From the implementational side, it'd probably make sense to look for RTL queries inside waitFor and some specific matchers, such as .not.toBeInTheDocument(), .toBeFalsy(), etc.
I am also curious about the fact that if this rule is enabled, it doesn't make too much sense to have query* queries in waitFor, even when waiting for appearance. Hence, the rule could either report by default or have an option to report this case:
This is an interesting one, few comments about it.
I think the list of "disappearance matchers" is already in the codebase, so we should aim to report that list.
I don't think the 2nd case you exposed would be in the scope of this rule. queryBy* + presence matcher is already reported by prefer-presence-queries, and reporting waitFor + presence matcher would fit better in prefer-find-by one.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
enhancementNew feature or requestnew ruleNew rule to be included in the pluginpinnedPinned for different reasons. Issues with this label won't be flagged as stale by stalebot
Activity
Belco90 commentedon Jul 18, 2021
This is an interesting one, few comments about it.
I think the list of "disappearance matchers" is already in the codebase, so we should aim to report that list.
I don't think the 2nd case you exposed would be in the scope of this rule.
queryBy*+ presence matcher is already reported byprefer-presence-queries, and reportingwaitFor+ presence matcher would fit better inprefer-find-byone.zaicevas commentedon Jul 19, 2021
Fair point.
Makes sense! I created an issue for it #420
stale commentedon Sep 17, 2021
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.