26 lines
880 B
Dart
26 lines
880 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:focus_seed/src/core/ambience.dart';
|
|
|
|
void main() {
|
|
group('dayPhaseFor', () {
|
|
test('uses the documented local time boundaries', () {
|
|
expect(dayPhaseFor(DateTime(2026, 6, 11, 4, 59)), DayPhase.night);
|
|
expect(dayPhaseFor(DateTime(2026, 6, 11, 5)), DayPhase.dawn);
|
|
expect(dayPhaseFor(DateTime(2026, 6, 11, 10)), DayPhase.day);
|
|
expect(dayPhaseFor(DateTime(2026, 6, 11, 17)), DayPhase.dusk);
|
|
expect(dayPhaseFor(DateTime(2026, 6, 11, 21)), DayPhase.night);
|
|
});
|
|
|
|
test('schedules the next boundary without background polling', () {
|
|
expect(
|
|
nextDayPhaseBoundary(DateTime(2026, 6, 11, 21, 15)),
|
|
DateTime(2026, 6, 12, 5),
|
|
);
|
|
expect(
|
|
nextDayPhaseBoundary(DateTime(2026, 6, 11, 8)),
|
|
DateTime(2026, 6, 11, 10),
|
|
);
|
|
});
|
|
});
|
|
}
|