From 373f8ea58e8f4e10fee4df71b9416bc4e8f8f687 Mon Sep 17 00:00:00 2001 From: kenny lopez Date: Fri, 23 Oct 2026 18:19:30 -0700 Subject: [PATCH] test(mobile): provide app scope for adaptive pane journeys Co-authored-by: Terp <5856f6900e8e0a4e0ea1f4f8d2ee33e4753d2119bc122f94ecafc660b46c0511@buzz.block.builderlab.xyz> Signed-off-by: kenny lopez --- .../home/adaptive_conversation_pane_test.dart | 66 ++++++++++--------- 1 file changed, 35 insertions(+), 31 deletions(-) diff --git a/mobile/test/features/home/adaptive_conversation_pane_test.dart b/mobile/test/features/home/adaptive_conversation_pane_test.dart index 2aae1783ae..ba215ac4ad 100644 --- a/mobile/test/features/home/adaptive_conversation_pane_test.dart +++ b/mobile/test/features/home/adaptive_conversation_pane_test.dart @@ -196,10 +196,12 @@ void main() { addTearDown(tester.view.reset); final navigator = GlobalKey(); await tester.pumpWidget( - MaterialApp( - navigatorKey: navigator, - theme: AppTheme.light(), - home: const Scaffold(body: Text('Home')), + ProviderScope( + child: MaterialApp( + navigatorKey: navigator, + theme: AppTheme.light(), + home: const Scaffold(body: Text('Home')), + ), ), ); navigator.currentState!.push( @@ -258,34 +260,36 @@ void main() { tester.view.physicalSize = const Size(900, 700); addTearDown(tester.view.reset); await tester.pumpWidget( - MaterialApp( - theme: AppTheme.light(), - home: Scaffold( - body: ValueListenableBuilder( - valueListenable: active, - builder: (context, isActive, _) => AdaptiveConversationPane( - active: isActive, - controller: controller, - list: Builder( - builder: (context) => Column( - children: [ - TextButton( - onPressed: () => ConversationPaneScope.maybeOf( - context, - )!.open('one', (_) => const _Conversation()), - child: const Text('First chat'), - ), - TextButton( - onPressed: () => - ConversationPaneScope.maybeOf(context)!.open( - 'two', - (_) => const Scaffold( - body: Text('Second conversation'), + ProviderScope( + child: MaterialApp( + theme: AppTheme.light(), + home: Scaffold( + body: ValueListenableBuilder( + valueListenable: active, + builder: (context, isActive, _) => AdaptiveConversationPane( + active: isActive, + controller: controller, + list: Builder( + builder: (context) => Column( + children: [ + TextButton( + onPressed: () => ConversationPaneScope.maybeOf( + context, + )!.open('one', (_) => const _Conversation()), + child: const Text('First chat'), + ), + TextButton( + onPressed: () => + ConversationPaneScope.maybeOf(context)!.open( + 'two', + (_) => const Scaffold( + body: Text('Second conversation'), + ), ), - ), - child: const Text('Second chat'), - ), - ], + child: const Text('Second chat'), + ), + ], + ), ), ), ),