Replace the UI-based tests and logic with a viewmodel that abstract the logic and provides clear methods