Refactor test cases for USB flow and port labels for improved readability

This commit is contained in:
just-stuff-tm 2026-03-04 14:22:28 -05:00
parent 25fc9454a8
commit 3452bdae8c
2 changed files with 6 additions and 13 deletions

View file

@ -172,18 +172,13 @@ void main() {
);
await tester.pumpAndSettle();
expect(
find.text('USB permission was denied.'),
findsOneWidget,
);
expect(find.text('USB permission was denied.'), findsOneWidget);
});
testWidgets(
'connection failure completes without leaving loading state',
(tester) async {
final connector = _FakeMeshCoreConnector(
ports: <String>['COM1'],
);
testWidgets('connection failure completes without leaving loading state', (
tester,
) async {
final connector = _FakeMeshCoreConnector(ports: <String>['COM1']);
var connectAttempted = false;
connector.connectUsbImpl = ({required String portName}) async {
connectAttempted = true;

View file

@ -46,9 +46,7 @@ void main() {
test('friendlyUsbPortName trims whitespace from label parts', () {
expect(
friendlyUsbPortName(
' /dev/ttyS0 - My Serial Port - n/a ',
),
friendlyUsbPortName(' /dev/ttyS0 - My Serial Port - n/a '),
'My Serial Port',
);
});