mirror of
https://github.com/zjs81/meshcore-open.git
synced 2026-04-20 22:13:48 +00:00
Refactor test cases for USB flow and port labels for improved readability
This commit is contained in:
parent
25fc9454a8
commit
3452bdae8c
2 changed files with 6 additions and 13 deletions
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue