mirror of
https://github.com/kuhyx/wake-alarm.git
synced 2026-11-21 17:22:18 +01:00
Some checks are pending
dependency freshness / dependencies on newest stable (push) Waiting to run
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) (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
Todo: 364208fc
26 lines
942 B
Dart
26 lines
942 B
Dart
import 'dart:convert';
|
|
import 'dart:io';
|
|
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:wake_alarm_sync/services/morning_session.dart';
|
|
|
|
/// The PC reads leg names (the keys of the published `passed` map) and labels
|
|
/// (its `next_step`) from the same literal: the Python half asserts it in
|
|
/// `wake_alarm/tests/test_session_legs.py`. Neither side's own round-trip can
|
|
/// catch a rename on the other.
|
|
void main() {
|
|
test('SessionLeg names and labels equal the shared fixture', () {
|
|
final raw = File(
|
|
'../wake_alarm/tests/fixtures/session_legs.json',
|
|
).readAsStringSync();
|
|
final legs = ((jsonDecode(raw) as Map<String, Object?>)['legs']! as List)
|
|
.cast<Map<String, dynamic>>();
|
|
expect(
|
|
<(String, String)>[for (final l in SessionLeg.values) (l.name, l.label)],
|
|
<(String, String)>[
|
|
for (final l in legs) (l['name'] as String, l['label'] as String),
|
|
],
|
|
);
|
|
});
|
|
}
|