Comments (6)
Sounds good to refactor the code first. I thought you were referring to adding tests for the view model explicitly, which we shouldn't do if possible.
from ground-android.
Also, as the current usage of AbstractTaskViewModel
is a bit big, I think we should create a separate issue for fixing the AbstractTaskViewModel.
WDYT?
from ground-android.
For the other tasks, we added tests for the task fragment which takes care of hilt dependencies automatically including the view model. This also provides coverage for what the user sees rather than testing the VM separately. Can you please check if we can do the same for CaptureLocationTask as well?
from ground-android.
Not sure I get it, but what I meant earlier is that we are passing the Resources object in the ViewModel, which is not a good practice and making our ViewModel dependent on the Android library.
So, we should separate the resource out of ViewModel and then go for writing correct test cases.
from ground-android.
Sounds good to refactor the code first. I thought you were referring to adding tests for the view model explicitly, which we shouldn't do if possible.
ok, great, for refactoring, I will create a separate issue.
Regarding testing viewModel, aren't we testing it separately? So, we are doing only UI tests for fragments and based on that we are confirming the viewModel is also tested, right? or did I missed anything?
from ground-android.
Regarding testing viewModel, aren't we testing it separately? So, we are doing only UI tests for fragments and based on that we are confirming the viewModel is also tested, right? or did I missed anything?
That's correct. The rationale is that this ensures that we have enough coverage for the fragment as well instead of having duplicate tests for UI and ViewModel
from ground-android.
Related Issues (20)
- [Code health] Android Resources in ViewModel is not good practice HOT 1
- [Code health] Automate License Addition to new file HOT 1
- [Code health] Add Unit Test for Polygon and Multipolygon
- [Code health] Add unit test for MapStateRepository
- [Code health] Add Unit Test MultipleChoiceItem
- [Code health] Add Unit Test for TaskNotFoundException
- LOIs not visible in Android app when running against local emulator
- Crash when clicking "Collect data" again in recently added geometry HOT 9
- Add support for converting repeated proto fields to firebase map
- LOIs not shown on map for some legacy surveys
- LOIs disappear from map after data is submitted
- LOIs not updating in app after being changed in backend
- Write submissions to remote db using new proto-based format HOT 1
- Multiple selection option font is enlarged HOT 1
- Cached Google Earth Imagery for offline useage HOT 6
- App doesn't start on some devices HOT 2
- [Take a photo] Photos are not stored in their correct orientation
- Offline and overflow icon in Survey Selector screen flickers on load
- [Code health] Add Unit Test for LocationOfInterestHelper
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ground-android.