Monitor ADB device presence and withdraw stale registrations in 0.2.6

This commit is contained in:
tongtong committed 2026-11-13 21:55:45 +08:00
1 parent 03e729a60b
commit dc29a20a41
17 files changed
+488 -23

No files matched your search

@@ -0,0 +1,25 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:ads_manager/data/agent_models.dart';
void main() {
test('unregistered phone shows its ADB absence reason', () {
const phone = ManagedPhone(
id: 'phone',
adbSerial: 'USB-A',
enabled: true,
connected: false,
lastError: 'ADB 未发现该设备',
);
expect(phone.description, contains('ADB 未发现'));
expect(phone.description, isNot(contains('已注册')));
});
test('disabled phone remains explicitly disabled', () {
const phone = ManagedPhone(
id: 'phone',
enabled: false,
connected: false,
lastError: 'offline',
);
expect(phone.description, contains('已停用'));
});
}