Skip to content

test(model): add unit tests for AlarmModel (#882)#883

Open
dorodb-web22 wants to merge 1 commit intoCCExtractor:mainfrom
dorodb-web22:test/alarm-model-unit-tests
Open

test(model): add unit tests for AlarmModel (#882)#883
dorodb-web22 wants to merge 1 commit intoCCExtractor:mainfrom
dorodb-web22:test/alarm-model-unit-tests

Conversation

@dorodb-web22
Copy link

Fixes #882

Description

Added a proper unit test file for AlarmModel. noticed while working on some other bugs that the data models don't have any test coverage right now, so i wrote these to lock down the expected behavior.

Proposed Changes

  • added 29 tests covering fromMap correctness (including edge cases like maxSnoozeCount defaulting to 3)
  • added toMap / fromMap roundtrip tests (especially verifying the mainAlarmTime conditional logic for shared alarms)
  • added valid encoding tests for toJson
  • added single-day rotation logic tests for boolListToString (verifying the sun-first storage vs mon-first list contract)

Besides, i left out tests for the fromJson constructor intentionally because it's currently broken on main ... there's an open PR #868 to fix that separately).*

Screenshots

n/a (unit tests only)

Checklist

  • Tests have been added or updated to cover the changes
  • Documentation has been updated to reflect the changes
  • Code follows the established coding style guidelines
  • All tests are passing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

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

1 participant