wake-alarm/phone_app/test/services/session_legs_fixture_test.dart
Krzysztof kuhy Rudnicki 52c3ff5f1e
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
Make wake-alarm text-free (textgate-rework)
Todo: 364208fc
2026-11-11 12:45:10 +01:00

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),
],
);
});
}