Fixed
Status Update
Comments
nk...@google.com <nk...@google.com> #2
The link in the above description doesn't work external to google, expanded link: https://issuetracker.google.com/issues/73450636
No update yet.
Description
I tried making a test case to verify that an error state has disappeared from an edittext, and noticed that the implementation of hasErrorText unconditionally dereferences view.getError(), which makes it impossible to use it to test against against the absence of an error state.
is it possible to update the code to support checks against null? For instance, the following one-line change in ViewMatchers.java should allow a nullValue matcher:
- return stringMatcher.matches(view.getError().toString());
+ return stringMatcher.matches((view.getError() != null) ? view.getError().toString() : null);
In addition, it seems that the documentation for withHint explicitly indicates that null is an option, whereas that mention is absent for getErrorText even though the situation exists in practice.