feat: better pairing broken notification
This commit is contained in:
23
test/util/bluetooth_settings_test.dart
Normal file
23
test/util/bluetooth_settings_test.dart
Normal file
@ -0,0 +1,23 @@
|
||||
import 'package:abawo_bt_app/util/bluetooth_settings.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('isBluetoothPairingRecoveryError', () {
|
||||
test('detects immediate disconnect connection failures', () {
|
||||
expect(
|
||||
isBluetoothPairingRecoveryError(
|
||||
'Failed to connect to device-id: disconnected',
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
});
|
||||
|
||||
test('does not classify generic connection failures as pairing recovery',
|
||||
() {
|
||||
expect(
|
||||
isBluetoothPairingRecoveryError('Timed out connecting to device-id'),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user