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:
+17
-4
@@ -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
|
||||
|
||||
---
|
||||
|
||||
|
||||
Reference in New Issue
Block a user