26 lines
729 B
Dart
26 lines
729 B
Dart
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('已停用'));
|
|
});
|
|
}
|