android / android/testing-samples

Why does BasicSample validate email field on every character change and not just when the Save button is pressed?

Open
#216 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Java
Stars
9.3k
Forks
3.6k
PR merge metrics
No merged PRs in 30d

Description

android-testing/unit/BasicSample adds a listener like this:
`mEmailText.addTextChangedListener(mEmailValidator);`
And then on save it checks
```
if (!mEmailValidator.isValid()) {
mEmailText.setError("Invalid email");}
```
Why not just have a simple utility class which will perform this check only when the save button is pressed?
Just asking for a clarification.

Contributor guide

Open the contributing guide

Research direction

Start in android-testing/unit/BasicSample and inspect the mEmailText listener and Save-button validation shown in the issue. Read the surrounding sample and its tests to determine whether the example is intended to demonstrate live validation or validation on submission; the issue does not define a concrete implementation or acceptance criterion.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, java
Domain
mobile, testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
20/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.