test: Add comprehensive unit tests

- IdleTimerTest.kt: 6 tests for timeout calculations
- ConfigValidationTest.kt: 16 tests for config validation
  - Homepage URL validation
  - Admin PIN validation (4-8 digits)
  - Whitelist parsing and normalization
- Updated IMPROVEMENTS.md with test coverage

Total unit tests: 29
This commit is contained in:
2026-02-03 15:12:54 +00:00
parent 3eae148419
commit 68a486cf9b
3 changed files with 200 additions and 4 deletions
+17 -4
View File
@@ -35,10 +35,23 @@ return whitelist.any { domain ->
| Component | Tests | Status |
|-----------|-------|--------|
| Whitelist matching | 6 | ✅ |
| Idle timer | TBD | ⏳ |
| Admin PIN | TBD | ⏳ |
| Boot receiver | TBD | ⏳ |
| Whitelist matching | 7 | ✅ |
| Idle timer | 6 | ✅ |
| Config validation | 16 | ✅ |
| Boot receiver | - | N/A (integration) |
**Total Unit Tests: 29**
### Test Files
- `WhitelistTest.kt` — URL whitelist logic with bypass prevention
- `IdleTimerTest.kt` — Timeout calculations and edge cases
- `ConfigValidationTest.kt` — Homepage, PIN, and whitelist validation
### Future Tests (Instrumented)
- [ ] WebView URL blocking behavior
- [ ] Admin PIN dialog flow
- [ ] Lock Task Mode integration
- [ ] Boot receiver launch
---