Retain boot chat deep links for Chats tab restore
This commit is contained in:
@@ -658,4 +658,52 @@ void main() {
|
||||
expect(tester.takeException(), isNull);
|
||||
},
|
||||
);
|
||||
testWidgets('Chats retap restores a boot deep link after folding and Back', (
|
||||
tester,
|
||||
) async {
|
||||
SharedPreferences.setMockInitialValues({});
|
||||
tester.view.physicalSize = const Size(1000, 1000);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
final channel = FakeChannel()..readyCompleter.complete();
|
||||
final client = PipelinesClient(channelFactory: (_) => channel);
|
||||
final provider = PlatformRouteInformationProvider(
|
||||
initialRouteInformation: RouteInformation(uri: Uri.parse('/chat/a')),
|
||||
);
|
||||
addTearDown(provider.dispose);
|
||||
addTearDown(client.dispose);
|
||||
await tester.pumpWidget(
|
||||
PipelinesApp(
|
||||
server: webServer(),
|
||||
client: client,
|
||||
cupertino: false,
|
||||
routeInformationProvider: provider,
|
||||
),
|
||||
);
|
||||
await tester.pump();
|
||||
await replyChatSessions(tester, channel, ['a']);
|
||||
await replyChatHistory(tester, channel, subscribeIndex: 0, historyIndex: 0);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.enterText(
|
||||
find.byKey(const Key('chat-composer-field')),
|
||||
'deep link draft',
|
||||
);
|
||||
tester.view.physicalSize = const Size(560, 1000);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byTooltip('Back').hitTestable());
|
||||
await tester.pumpAndSettle();
|
||||
expect(provider.value.uri.path, '/chat');
|
||||
await tester.tap(find.byKey(const ValueKey('shell.destination.chat')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(provider.value.uri.path, '/chat/a');
|
||||
expect(find.byType(ChatThreadView), findsOneWidget);
|
||||
expect(
|
||||
tester
|
||||
.widget<TextField>(find.byKey(const Key('chat-composer-field')))
|
||||
.controller!
|
||||
.text,
|
||||
'deep link draft',
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user