Show the phone terminal shortcut on the Chat tab only
This commit is contained in:
@@ -36,6 +36,7 @@ void main() {
|
||||
Future<void> pumpApp(
|
||||
WidgetTester tester, {
|
||||
Size size = const Size(1200, 800),
|
||||
bool onChat = true,
|
||||
}) async {
|
||||
tester.view.physicalSize = size;
|
||||
tester.view.devicePixelRatio = 1;
|
||||
@@ -46,6 +47,7 @@ void main() {
|
||||
hub: hub,
|
||||
layout: layout,
|
||||
cupertino: false,
|
||||
shortcutHere: onChat,
|
||||
child: Scaffold(
|
||||
appBar: AppBar(
|
||||
title: const Text('App'),
|
||||
@@ -289,6 +291,22 @@ void main() {
|
||||
expect(bubble, findsNothing);
|
||||
},
|
||||
);
|
||||
|
||||
desktopTestWidgets('the phone shortcut shows on the Chat tab only', (
|
||||
tester,
|
||||
) async {
|
||||
await pumpApp(tester, size: const Size(390, 800), onChat: false);
|
||||
final bubble = find.byKey(const Key('terminal-shortcut-bubble'));
|
||||
await tester.tap(find.byTooltip(TerminalToggleButton.label));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.pageBack();
|
||||
await tester.pumpAndSettle();
|
||||
expect(hub.tabs, isNotEmpty);
|
||||
expect(bubble, findsNothing, reason: 'not on Pipelines, Runs or Search');
|
||||
await pumpApp(tester, size: const Size(390, 800));
|
||||
await tester.pumpAndSettle();
|
||||
expect(bubble, findsOneWidget, reason: 'shown on Chat');
|
||||
});
|
||||
}
|
||||
|
||||
/// Hardware keys reach the terminal on desktop; phones type through the
|
||||
|
||||
Reference in New Issue
Block a user