mirror of
https://github.com/kuhyx/utils.git
synced 2026-11-10 19:07:17 +01:00
Extracts the near-identical "Sync settings" UI duplicated across 5 apps (todo, diet_guard_app, workout_app, wake_alarm/phone_app, home_inventory) into a single tested package. Firebase sync (primary) + optional local backup slot; GitHub mirror UI was dropped per kuhy's explicit decision mid-build in favor of Firebase-only, so existing apps keep their local GitHub code untouched, just disconnected from this shared screen. 100% line coverage, flutter analyze clean under very_good_analysis. Generalized check_no_crdt_sync_override.sh to guard any utils git dependency (crdt_sync, sync_settings_ui), not just crdt_sync by name. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KdSp6Nbrs9xvsWkCMDN9a1
20 lines
542 B
Dart
20 lines
542 B
Dart
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:sync_settings_ui/sync_settings_ui.dart';
|
|
|
|
void main() {
|
|
test('carries the label and invokes the injected callbacks', () async {
|
|
var exported = false;
|
|
var imported = false;
|
|
final slot = BackupSlot(
|
|
label: 'notes',
|
|
export: () async => exported = true,
|
|
import: () async => imported = true,
|
|
);
|
|
expect(slot.label, 'notes');
|
|
await slot.export();
|
|
await slot.import();
|
|
expect(exported, isTrue);
|
|
expect(imported, isTrue);
|
|
});
|
|
}
|