Skip to content

Commit

Permalink
Fix test failure intorduced in #504 (#507)
Browse files Browse the repository at this point in the history
  • Loading branch information
derdilla authored Jan 16, 2025
1 parent 51c9841 commit aa972de
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
29 changes: 15 additions & 14 deletions app/lib/features/input/add_measurement_dialoge.dart
Original file line number Diff line number Diff line change
Expand Up @@ -260,20 +260,21 @@ class _AddEntryDialogeState extends State<AddEntryDialoge> {
child: ListView(
padding: const EdgeInsets.symmetric(horizontal: 8),
children: [
(() => switch (settings.bleInput) {
BluetoothInputMode.disabled => SizedBox.shrink(),
BluetoothInputMode.oldBluetoothInput => OldBluetoothInput(
onMeasurement: _onExternalMeasurement,
),
BluetoothInputMode.newBluetoothInputOldLib => BluetoothInput(
manager: BluetoothManager.create(isTestingEnvironment ? BluetoothBackend.mock : BluetoothBackend.flutterBluePlus),
onMeasurement: _onExternalMeasurement,
),
BluetoothInputMode.newBluetoothInputCrossPlatform => BluetoothInput(
manager: BluetoothManager.create(isTestingEnvironment ? BluetoothBackend.mock : BluetoothBackend.bluetoothLowEnergy),
onMeasurement: _onExternalMeasurement,
),
})(),
if (!isTestingEnvironment) // TODO: test feature (#494)
(() => switch (settings.bleInput) {
BluetoothInputMode.disabled => SizedBox.shrink(),
BluetoothInputMode.oldBluetoothInput => OldBluetoothInput(
onMeasurement: _onExternalMeasurement,
),
BluetoothInputMode.newBluetoothInputOldLib => BluetoothInput(
manager: BluetoothManager.create(BluetoothBackend.flutterBluePlus),
onMeasurement: _onExternalMeasurement,
),
BluetoothInputMode.newBluetoothInputCrossPlatform => BluetoothInput(
manager: BluetoothManager.create( BluetoothBackend.bluetoothLowEnergy),
onMeasurement: _onExternalMeasurement,
),
})(),
if (settings.allowManualTimeInput)
DateTimeForm(
validate: settings.validateInputs,
Expand Down
2 changes: 1 addition & 1 deletion app/test/features/input/add_measurement_dialoge_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ void main() {
await tester.pumpAndSettle();
expect(find.byType(BluetoothInput), findsNothing);
});
});
}, skip: true);
group('showAddEntryDialoge', () {
testWidgets('should return null on cancel', (tester) async {
dynamic result = 'result before save';
Expand Down

0 comments on commit aa972de

Please sign in to comment.