mirror of
https://github.com/dz0ny/meshcore-sar.git
synced 2026-08-11 16:30:28 +00:00
Improve sensor settings UI
This commit is contained in:
@@ -46,4 +46,46 @@ void main() {
|
||||
);
|
||||
expect(find.text('Channel 2'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('omits duplicate channel chip for channel 1', (tester) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Scaffold(
|
||||
body: SensorMetricSelectorItem(
|
||||
option: const SensorMetricOption(
|
||||
key: 'battery',
|
||||
label: 'Battery',
|
||||
defaultLabel: 'Battery',
|
||||
channel: 1,
|
||||
valuePreview: '84%',
|
||||
previewCardData: SensorMetricCardData(
|
||||
fieldKey: 'battery',
|
||||
icon: Icons.battery_5_bar,
|
||||
label: 'Battery',
|
||||
value: '84%',
|
||||
accent: Color(0xFF4B8E2F),
|
||||
channel: 1,
|
||||
),
|
||||
),
|
||||
visible: true,
|
||||
span: 1,
|
||||
canMoveUp: true,
|
||||
canMoveDown: true,
|
||||
onToggle: (_) {},
|
||||
onRename: () {},
|
||||
onMoveUp: () {},
|
||||
onMoveDown: () {},
|
||||
onSpanChanged: (_) {},
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
expect(find.text('Rename'), findsOneWidget);
|
||||
expect(
|
||||
find.byKey(const ValueKey('sensor_selector_channel_battery')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(find.text('Channel 1'), findsNothing);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user