mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-26 02:07:12 +01:00
Some checks are pending
md-naming / markdown naming convention (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (mypy, mypy, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (pylint, pylint, ) (push) Waiting to run
pre-commit / pre-commit (${{ matrix.group }}) (rest, , mypy,pylint,free-days-interop,dependency-freshness) (push) Waiting to run
Tests / test (push) Waiting to run
Tests / free-days-interop (push) Waiting to run
release-apk / release (APK) (push) Waiting to run
repo-contract / repo contract (push) Waiting to run
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
32 lines
1.1 KiB
Dart
32 lines
1.1 KiB
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:wake_alarm_sync/services/morning_session.dart';
|
|
import 'package:wake_alarm_sync/services/session_rules.dart';
|
|
import 'package:wake_alarm_sync/services/session_tag_settings.dart';
|
|
|
|
final DateTime t0 = DateTime(2026, 9, 17, 8, 5);
|
|
|
|
MorningSession fresh() => SessionRules.start(
|
|
now: t0,
|
|
tags: const SessionTagSettings(tagIds: <String>['bath', 'ward', 'desk']),
|
|
nfcAvailable: true,
|
|
);
|
|
|
|
void main() {
|
|
test('a bypass re-ring is named for its cause and counted once', () {
|
|
final s = fresh()
|
|
..markReRing('deadline:bathroomIn', t0)
|
|
..adoptBypassReRing('fsi_revoked')
|
|
..recordReRing(t0.add(const Duration(minutes: 3)));
|
|
expect(s.reRings, 1);
|
|
expect(s.reRingReasons, <String>['bypass:fsi_revoked']);
|
|
});
|
|
|
|
test('no bypass stamped keeps the deadline reason', () {
|
|
final s = fresh()
|
|
..markReRing('deadline:bathroomIn', t0)
|
|
..adoptBypassReRing(null)
|
|
..recordReRing(t0.add(const Duration(minutes: 3)));
|
|
expect(s.reRingReasons, <String>['deadline:bathroomIn']);
|
|
});
|
|
}
|