From 97d7be55ecb10041db2982a8fff4a4a77b6336ea Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Wed, 21 Oct 2026 21:08:14 +0100 Subject: [PATCH] fix(app): integrate Changes tests with shared actions gateway --- app/lib/features/runs/data/runs_repository.dart | 3 +++ .../features/runs/ui/run_changes_action_test.dart | 6 +++++- .../features/runs/ui/run_changes_status_test.dart | 6 +++++- .../features/runs/ui/run_detail_widget_test.dart | 13 +++++++++---- app/tool/diff_wiring_probe.dart | 6 +++++- 5 files changed, 27 insertions(+), 7 deletions(-) diff --git a/app/lib/features/runs/data/runs_repository.dart b/app/lib/features/runs/data/runs_repository.dart index 5a1ea8c4..e7dbd14f 100644 --- a/app/lib/features/runs/data/runs_repository.dart +++ b/app/lib/features/runs/data/runs_repository.dart @@ -15,6 +15,9 @@ class RunsRepository { RunsRepository(this._gateway); final ApiGateway _gateway; + /// Composition/actions reuse this feature's existing gateway, never a socket. + ApiGateway get gateway => _gateway; + Future listRuns() async { final reply = await _gateway.call('list_runs'); final runs = reply['runs']; diff --git a/app/test/features/runs/ui/run_changes_action_test.dart b/app/test/features/runs/ui/run_changes_action_test.dart index 62a6c0a7..6d9aff47 100644 --- a/app/test/features/runs/ui/run_changes_action_test.dart +++ b/app/test/features/runs/ui/run_changes_action_test.dart @@ -59,7 +59,11 @@ Future _pumpDetail( tester.view.physicalSize = const Size(500, 1200); tester.view.devicePixelRatio = 1; addTearDown(tester.view.reset); - final view = RunDetailView(controller: controller, onBack: () {}); + final view = RunDetailView( + controller: controller, + gateway: controller.repository.gateway, + onBack: () {}, + ); await tester.pumpWidget( platform == _Platform.material ? MaterialApp(home: Scaffold(body: view)) diff --git a/app/test/features/runs/ui/run_changes_status_test.dart b/app/test/features/runs/ui/run_changes_status_test.dart index bdaf6c8d..38318ddd 100644 --- a/app/test/features/runs/ui/run_changes_status_test.dart +++ b/app/test/features/runs/ui/run_changes_status_test.dart @@ -62,7 +62,11 @@ Future _pumpDetail( final controller = RunsController(RunsRepository(_FakeGateway(run))); addTearDown(controller.dispose); await controller.select(9); - final view = RunDetailView(controller: controller, onBack: () {}); + final view = RunDetailView( + controller: controller, + gateway: controller.repository.gateway, + onBack: () {}, + ); await tester.pumpWidget( platform == _Platform.material ? MaterialApp( diff --git a/app/test/features/runs/ui/run_detail_widget_test.dart b/app/test/features/runs/ui/run_detail_widget_test.dart index 1557b2b5..0f5c0673 100644 --- a/app/test/features/runs/ui/run_detail_widget_test.dart +++ b/app/test/features/runs/ui/run_detail_widget_test.dart @@ -163,13 +163,18 @@ void main() { await tester.tap(find.text('Input')); await tester.pumpAndSettle(); expect(find.textContaining('"alpha": 1'), findsOneWidget); - await tester.scrollUntilVisible( - find.text('Output'), - 200, - scrollable: find.byType(Scrollable).first, + await tester.dragUntilVisible( + find.text('Output').hitTestable(), + find.byType(ListView).first, + const Offset(0, -200), ); await tester.tap(find.text('Output')); await tester.pumpAndSettle(); + await tester.dragUntilVisible( + find.textContaining('"ok": true').hitTestable(), + find.byType(ListView).first, + const Offset(0, -100), + ); expect(find.textContaining('"ok": true'), findsOneWidget); await tester.scrollUntilVisible( diff --git a/app/tool/diff_wiring_probe.dart b/app/tool/diff_wiring_probe.dart index 40515069..0d4f9552 100644 --- a/app/tool/diff_wiring_probe.dart +++ b/app/tool/diff_wiring_probe.dart @@ -173,7 +173,11 @@ class _ProbeBodyState extends State<_ProbeBody> { @override Widget build(BuildContext context) { - final detail = RunDetailView(controller: _controller, onBack: () {}); + final detail = RunDetailView( + controller: _controller, + gateway: _controller.repository.gateway, + onBack: () {}, + ); if (Theme.of(context).platform == TargetPlatform.iOS) { return CupertinoPageScaffold( navigationBar: const CupertinoNavigationBar(middle: Text('Runs')),