Skip to content

Enhancement: Add unit tests for AlarmModel (currently zero test coverage) #882

@dorodb-web22

Description

@dorodb-web22

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions