fix undefined repository test in ViewModel constructor