@@ -30,6 +30,7 @@ import 'package:pyble/app/providers.dart';
3030import 'package:pyble/console/console.dart' ;
3131import 'package:pyble/editor/editor.dart' ;
3232import 'package:pyble/files/files.dart' ;
33+ import 'package:pyble/localization/localization.dart' ;
3334import 'package:pyble/pble/pble.dart' ;
3435
3536import '../support/shell_harness.dart' ;
@@ -55,6 +56,9 @@ const ValueKey<String> _pillKey = ValueKey<String>('connStatusPill');
5556Finder _pillLabel (String word) =>
5657 find.descendant (of: find.byKey (_pillKey), matching: find.text (word));
5758
59+ AppLocalizations _l10n (WidgetTester tester) =>
60+ AppLocalizations .of (tester.element (find.byType (Scaffold ).first));
61+
5862/// The run-control toolbar action tooltips (ARB: toolbar{Run,Stop,SoftReboot}).
5963/// These always render; their ENABLED state is state-driven from run-control
6064/// (A-16, covered by run_toolbar_test.dart). The connection action is separate:
@@ -213,6 +217,73 @@ void main() {
213217 expect (_pillLabel ('Ready' ), findsOneWidget);
214218 expect (_pillLabel ('Disconnected' ), findsNothing);
215219 });
220+
221+ testWidgets (
222+ 'connected pill retains board ID and firmware after Connect unmounts' ,
223+ (tester) async {
224+ await pumpShell (
225+ tester,
226+ connection: fakeConnection (
227+ initial: ConnState .ready,
228+ info: fakeDeviceInfo (deviceId: '5646' , agentVersion: '0.6.0' ),
229+ ),
230+ surface: ipadLandscape,
231+ );
232+
233+ final AppLocalizations l10n = _l10n (tester);
234+ expect (
235+ find.descendant (
236+ of: find.byKey (_pillKey),
237+ matching: find.text (
238+ l10n.connStatusWithBoardInfo ('Ready' , '5646' , '0.6.0' ),
239+ ),
240+ ),
241+ findsOneWidget,
242+ );
243+ expect (
244+ find.bySemanticsLabel (
245+ l10n.connStatusBoardInfoSemanticLabel ('Ready' , '5646' , '0.6.0' ),
246+ ),
247+ findsOneWidget,
248+ );
249+ expect (
250+ find.text (l10n.connectDeviceInfoTitle),
251+ findsNothing,
252+ reason: 'ADR-0011 replaces the Connect surface once ready' ,
253+ );
254+ },
255+ );
256+
257+ testWidgets (
258+ 'connected pill reports empty additive metadata without gating' ,
259+ (tester) async {
260+ await pumpShell (
261+ tester,
262+ connection: fakeConnection (
263+ initial: ConnState .ready,
264+ info: fakeDeviceInfo (deviceId: '' , agentVersion: '' ),
265+ ),
266+ surface: phonePortrait,
267+ );
268+
269+ final AppLocalizations l10n = _l10n (tester);
270+ expect (
271+ find.descendant (
272+ of: find.byKey (_pillKey),
273+ matching: find.text (
274+ l10n.connStatusWithBoardInfo (
275+ 'Ready' ,
276+ l10n.connectDeviceNotReported,
277+ l10n.connectDeviceNotReported,
278+ ),
279+ ),
280+ ),
281+ findsOneWidget,
282+ );
283+ expect (tester.takeException (), isNull);
284+ expect (find.byTooltip ('Disconnect' ), findsOneWidget);
285+ },
286+ );
216287 });
217288
218289 group ('FR-UI-1 collapsible landscape Files sidebar' , () {
0 commit comments