Note:- I have added android and iOS tags to this question but it is not necessarily restricted to those platforms.
Consider a simple registration form where the the value of one field dictates what other fields are shown and how they are shown. For example, imagine the following
- You start off by selecting your country from a drop-down/list
- If the native language of that country is not English, you display a text field to enter the language.
Question: What strategy would one adopt to test such a form?
To elaborate a bit, of late there has been a push from both the Android and iOS developer communities to move away from MVC (well, on Android that has never existed really) towards other architectures like MVVM or MVP. One major reason cited for this is that sticking to traditional architectures conflates responsibilities of what ought to be several distinct layers. Separating them into derivatives of MVC makes testing easier.
Secondly, both MVVM and MVP have the advantage of isolating the View layer to such an extent that everything right up to view logic can be tested without ever having to touch a real view object. On Android, this means being able to run pure JVM Junit tests to test the view logic.
I suppose my example above falls under the category of view logic. However, it is not clear to me how I can test this without actually instantiating a real View object. Conceptually, I want to verify that if user chooses a country that speaks English natively, then the text field to enter a language is not shown. Otherwise, the text field is shown. How does this translate to non-UI tests?