feat: Enable stats by default and enrich public dashboard

This commit is contained in:
Janez T
2026-04-03 22:24:09 +02:00
parent 59931f402a
commit 5feb07aad7
9 changed files with 422 additions and 42 deletions

View File

@@ -68,7 +68,7 @@ void main() {
await service.initialize(
deviceKey6Provider: () => 'a1b2c3d4e5f6',
);
await service.setEnabled(true);
expect(service.isEnabled, isTrue);
await service.processLogs(<BlePacketLog>[
_log(
timestamp: DateTime.utc(2026, 4, 3, 10, 0, 5),

View File

@@ -42,7 +42,7 @@ void main() {
);
});
testWidgets('toggles reporting with a fixed 5 minute interval', (
testWidgets('starts enabled by default and can be disabled', (
tester,
) async {
SharedPreferences.setMockInitialValues({});
@@ -76,12 +76,12 @@ void main() {
findsOneWidget,
);
expect(find.text('Reporting interval'), findsNothing);
expect(service.isEnabled, isFalse);
expect(service.isEnabled, isTrue);
await tester.tap(find.byType(Switch));
await tester.pumpAndSettle();
expect(service.isEnabled, isTrue);
expect(service.isEnabled, isFalse);
expect(service.intervalMinutes, 5);
await tester.tap(find.widgetWithText(TextButton, 'View public stats'));