Description
While working on some bug fixes in the data layer, I noticed the test/ directory only has a single file (splash_screen_view_test.dart) that checks if an Image widget exists on the splash screen.
There's no test coverage at all for the data models or providers.
AlarmModel in particular has 65+ fields, multiple constructors (fromMap, fromJson, fromDocumentSnapshot), and serialization helpers (toMap, toJson) , all completely untested. My recent PRs (#868, #879) both caught bugs in this exact layer that tests would have caught automatically.
What I would like to add
A proper unit test suite for AlarmModel covering:
- Constructor correctness (default, fromMap,
fromJson)
- Serialization roundtrips (toMap → fromMap, toJson →
fromJson)
- Edge cases (empty strings, boundary values for fields like
minutesSinceMidnight)
- Day list encoding/decoding via boolListToString
Description
While working on some bug fixes in the data layer, I noticed the test/ directory only has a single file (splash_screen_view_test.dart) that checks if an Image widget exists on the splash screen.
There's no test coverage at all for the data models or providers.
AlarmModel in particular has 65+ fields, multiple constructors (fromMap,
fromJson,fromDocumentSnapshot), and serialization helpers (toMap, toJson) , all completely untested. My recent PRs (#868, #879) both caught bugs in this exact layer that tests would have caught automatically.What I would like to add
A proper unit test suite for AlarmModel covering:
fromJson)fromJson)minutesSinceMidnight)