Fix the 11 failing application tests: two product fixes, stale fixtures
Product: - Settings jump index scrolls instead of overflowing a short wide window (overflowed by 48 px at 1200x800 once Open in chat added a section). - Chat: a route to the retained workspace's active pane shows it in the same frame again;ec3c1e4cdeferred it a frame behind a post-frame callback. Tests updated to intended behaviour: - first-run walkthrough (30ba70ad): seed a device that has seen it and was offered it for the fixture server; - Output section open by default (22af093e); - chat page Back closes its own route explicitly (19b1d132); - open-chat sync (c48a1559): answer chat_open_workspace statefully; - keyed session list (0a51add9) no longer re-reads chat_sessions on open. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -407,7 +407,17 @@ class _ChatScreenState extends State<ChatScreen>
|
|||||||
id != null &&
|
id != null &&
|
||||||
id.isNotEmpty &&
|
id.isNotEmpty &&
|
||||||
(_workspace.activePane?.sessionId != id || !_workspaceVisible);
|
(_workspace.activePane?.sessionId != id || !_workspaceVisible);
|
||||||
if (!reboundWorkspace && (routeChanged || targetIsNotActive)) {
|
if (!reboundWorkspace &&
|
||||||
|
targetIsNotActive &&
|
||||||
|
_workspace.activePane?.sessionId == id) {
|
||||||
|
// The routed chat is already the retained workspace's active pane (a
|
||||||
|
// Chats re-tap, or Back then forward): only its visibility changes, which
|
||||||
|
// notifies nothing, so it is shown in this frame and its entrance starts
|
||||||
|
// with the tap rather than a frame later.
|
||||||
|
_workspaceVisible = true;
|
||||||
|
_publishedWorkspaceSession = id;
|
||||||
|
_workspaceBinding?.changed();
|
||||||
|
} else if (!reboundWorkspace && (routeChanged || targetIsNotActive)) {
|
||||||
// The parent is rebuilding while didUpdateWidget runs. Opening a pane
|
// The parent is rebuilding while didUpdateWidget runs. Opening a pane
|
||||||
// notifies the workspace's ListenableBuilder, which must happen after
|
// notifies the workspace's ListenableBuilder, which must happen after
|
||||||
// this build rather than during it.
|
// this build rather than during it.
|
||||||
|
|||||||
@@ -41,7 +41,9 @@ class SettingsSearchField extends StatelessWidget {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The wide layout's slim jump index: one link per visible section.
|
/// The wide layout's slim jump index: one link per visible section. It
|
||||||
|
/// scrolls on its own when a short window cannot fit every link, so the last
|
||||||
|
/// sections stay reachable instead of overflowing the page.
|
||||||
class SettingsSectionIndex extends StatelessWidget {
|
class SettingsSectionIndex extends StatelessWidget {
|
||||||
const SettingsSectionIndex({
|
const SettingsSectionIndex({
|
||||||
super.key,
|
super.key,
|
||||||
@@ -56,24 +58,28 @@ class SettingsSectionIndex extends StatelessWidget {
|
|||||||
Widget build(BuildContext context) => Semantics(
|
Widget build(BuildContext context) => Semantics(
|
||||||
container: true,
|
container: true,
|
||||||
label: 'Settings sections',
|
label: 'Settings sections',
|
||||||
child: Column(
|
child: SingleChildScrollView(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
// The page's own list owns the primary controller.
|
||||||
mainAxisSize: MainAxisSize.min,
|
primary: false,
|
||||||
children: <Widget>[
|
child: Column(
|
||||||
for (final section in sections)
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
TextButton(
|
mainAxisSize: MainAxisSize.min,
|
||||||
key: ValueKey<String>('settings.index.${section.id}'),
|
children: <Widget>[
|
||||||
onPressed: () => onJump(section.id),
|
for (final section in sections)
|
||||||
style: TextButton.styleFrom(
|
TextButton(
|
||||||
alignment: AlignmentDirectional.centerStart,
|
key: ValueKey<String>('settings.index.${section.id}'),
|
||||||
|
onPressed: () => onJump(section.id),
|
||||||
|
style: TextButton.styleFrom(
|
||||||
|
alignment: AlignmentDirectional.centerStart,
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
section.title,
|
||||||
|
textAlign: TextAlign.start,
|
||||||
|
overflow: TextOverflow.ellipsis,
|
||||||
|
),
|
||||||
),
|
),
|
||||||
child: Text(
|
],
|
||||||
section.title,
|
),
|
||||||
textAlign: TextAlign.start,
|
|
||||||
overflow: TextOverflow.ellipsis,
|
|
||||||
),
|
|
||||||
),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ Future<Map<String, dynamic>> waitForRequest(
|
|||||||
// Automation metadata is independently requested before history. This
|
// Automation metadata is independently requested before history. This
|
||||||
// fixture has no provider schedules; answer unavailable rather than leave
|
// fixture has no provider schedules; answer unavailable rather than leave
|
||||||
// the correlated transport blocked behind an unanswered request.
|
// the correlated transport blocked behind an unanswered request.
|
||||||
|
// The open-chat sync reads and writes `chat_open_workspace` around opening
|
||||||
|
// a chat; the serialized transport holds every later request behind it.
|
||||||
|
if (type != 'chat_open_workspace') answerOpenWorkspaceRequests(channel);
|
||||||
if (type != 'chat_automations') {
|
if (type != 'chat_automations') {
|
||||||
for (final raw in channel.outgoing.toList()) {
|
for (final raw in channel.outgoing.toList()) {
|
||||||
final metadata = jsonDecode(raw as String) as Map<String, dynamic>;
|
final metadata = jsonDecode(raw as String) as Map<String, dynamic>;
|
||||||
@@ -222,36 +225,53 @@ Future<void> replyChatSessions(
|
|||||||
await tester.pump();
|
await tester.pump();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Answers the `chat_open_workspace` requests the app sends around opening a
|
/// The fixture server's open-chat set per channel, as the real
|
||||||
/// chat (main's open-chat sync), so the chat can subscribe. A read gets an
|
/// `chat_open_workspace` holds it: a revision and its entries.
|
||||||
/// empty set; a write is stored at the next revision with its own entries.
|
final _openWorkspaces = Expando<({int revision, List<Object?> entries})>();
|
||||||
/// Each request is answered once.
|
|
||||||
|
/// Answers every unanswered `chat_open_workspace` request the app has sent
|
||||||
|
/// (the open-chat sync), so the chat can subscribe. A read gets the stored set
|
||||||
|
/// (empty at first); a write is stored at the next revision with its own
|
||||||
|
/// entries. Each request is answered once, sharing [waitForRequest]'s record
|
||||||
|
/// of replies.
|
||||||
|
void answerOpenWorkspaceRequests(FakeChannel channel) {
|
||||||
|
final answered = _fixtureAutomationReplies[channel] ??= <String>{};
|
||||||
|
for (final raw in channel.outgoing.toList()) {
|
||||||
|
final message = jsonDecode(raw as String) as Map<String, dynamic>;
|
||||||
|
if (message['type'] != 'chat_open_workspace' ||
|
||||||
|
!answered.add('${message['id']}')) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var stored =
|
||||||
|
_openWorkspaces[channel] ?? (revision: 0, entries: const <Object?>[]);
|
||||||
|
final write = message['chat_open_workspace_request'] as Map?;
|
||||||
|
if (write != null) {
|
||||||
|
stored = (
|
||||||
|
revision: stored.revision + 1,
|
||||||
|
entries: List<Object?>.of(write['entries'] as List),
|
||||||
|
);
|
||||||
|
_openWorkspaces[channel] = stored;
|
||||||
|
}
|
||||||
|
channel.incoming.add(
|
||||||
|
jsonEncode({
|
||||||
|
'id': message['id'],
|
||||||
|
'type': 'chat_open_workspace',
|
||||||
|
'chat_open_workspace': {
|
||||||
|
'revision': stored.revision,
|
||||||
|
'entries': stored.entries,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Answers the `chat_open_workspace` requests sent over a few frames.
|
||||||
Future<void> answerOpenWorkspace(
|
Future<void> answerOpenWorkspace(
|
||||||
WidgetTester tester,
|
WidgetTester tester,
|
||||||
FakeChannel channel,
|
FakeChannel channel,
|
||||||
) async {
|
) async {
|
||||||
final answered = <Object?>{};
|
|
||||||
for (var attempt = 0; attempt < 20; attempt++) {
|
for (var attempt = 0; attempt < 20; attempt++) {
|
||||||
for (final raw in channel.outgoing.toList()) {
|
answerOpenWorkspaceRequests(channel);
|
||||||
final message = jsonDecode(raw as String) as Map<String, dynamic>;
|
|
||||||
if (message['type'] != 'chat_open_workspace' ||
|
|
||||||
!answered.add(message['id'])) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
final write = message['chat_open_workspace_request'] as Map?;
|
|
||||||
channel.incoming.add(
|
|
||||||
jsonEncode({
|
|
||||||
'id': message['id'],
|
|
||||||
'type': 'chat_open_workspace',
|
|
||||||
'chat_open_workspace': write == null
|
|
||||||
? {'revision': 0, 'entries': const []}
|
|
||||||
: {
|
|
||||||
'revision': (write['base_revision'] as num) + 1,
|
|
||||||
'entries': write['entries'],
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
await tester.pump(const Duration(milliseconds: 5));
|
await tester.pump(const Duration(milliseconds: 5));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -381,74 +401,73 @@ void main() {
|
|||||||
},
|
},
|
||||||
);
|
);
|
||||||
|
|
||||||
testWidgets(
|
testWidgets('a mounted chat notification route activates a different chat', (
|
||||||
'a mounted chat notification route activates a different chat',
|
tester,
|
||||||
(tester) async {
|
) async {
|
||||||
tester.view.physicalSize = const Size(900, 900);
|
tester.view.physicalSize = const Size(900, 900);
|
||||||
tester.view.devicePixelRatio = 1;
|
tester.view.devicePixelRatio = 1;
|
||||||
addTearDown(tester.view.resetPhysicalSize);
|
addTearDown(tester.view.resetPhysicalSize);
|
||||||
addTearDown(tester.view.resetDevicePixelRatio);
|
addTearDown(tester.view.resetDevicePixelRatio);
|
||||||
|
|
||||||
final channel = FakeChannel()..readyCompleter.complete();
|
final channel = FakeChannel()..readyCompleter.complete();
|
||||||
final client = PipelinesClient(channelFactory: (_) => channel);
|
final client = PipelinesClient(channelFactory: (_) => channel);
|
||||||
final provider = PlatformRouteInformationProvider(
|
final provider = PlatformRouteInformationProvider(
|
||||||
initialRouteInformation: RouteInformation(uri: Uri.parse('/chat/old')),
|
initialRouteInformation: RouteInformation(uri: Uri.parse('/chat/old')),
|
||||||
);
|
);
|
||||||
addTearDown(provider.dispose);
|
addTearDown(provider.dispose);
|
||||||
|
|
||||||
await tester.pumpWidget(
|
await tester.pumpWidget(
|
||||||
PipelinesApp(
|
PipelinesApp(
|
||||||
androidSupported: false,
|
androidSupported: false,
|
||||||
server: webServer(),
|
server: webServer(),
|
||||||
client: client,
|
client: client,
|
||||||
routeInformationProvider: provider,
|
routeInformationProvider: provider,
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
|
||||||
await replyChatSessions(tester, channel, ['old', 'target']);
|
await replyChatSessions(tester, channel, ['old', 'target']);
|
||||||
await replyChatHistory(
|
await replyChatHistory(
|
||||||
tester,
|
tester,
|
||||||
channel,
|
channel,
|
||||||
subscribeIndex: 0,
|
subscribeIndex: 0,
|
||||||
historyIndex: 0,
|
historyIndex: 0,
|
||||||
text: 'The retained chat.',
|
text: 'The retained chat.',
|
||||||
);
|
);
|
||||||
expect(find.text('The retained chat.'), findsOneWidget);
|
expect(find.text('The retained chat.'), findsOneWidget);
|
||||||
|
|
||||||
// This is the route delivered by a native chat notification, not a
|
// This is the route delivered by a native chat notification, not a
|
||||||
// direct ChatScreen replacement.
|
// direct ChatScreen replacement.
|
||||||
await provider.didPushRouteInformation(
|
await provider.didPushRouteInformation(
|
||||||
RouteInformation(uri: Uri.parse('/chat/target')),
|
RouteInformation(uri: Uri.parse('/chat/target')),
|
||||||
);
|
);
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
expect(provider.value.uri.path, '/chat/target');
|
expect(provider.value.uri.path, '/chat/target');
|
||||||
|
|
||||||
await replyChatHistory(
|
await replyChatHistory(
|
||||||
tester,
|
tester,
|
||||||
channel,
|
channel,
|
||||||
subscribeIndex: 1,
|
subscribeIndex: 1,
|
||||||
historyIndex: 1,
|
historyIndex: 1,
|
||||||
text: 'The notified chat.',
|
text: 'The notified chat.',
|
||||||
);
|
);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
expect(requestOf(channel, 'chat_subscribe', index: 1)!['chat_subscribe'], {
|
expect(requestOf(channel, 'chat_subscribe', index: 1)!['chat_subscribe'], {
|
||||||
'session_id': 'target',
|
'session_id': 'target',
|
||||||
});
|
});
|
||||||
expect(requestOf(channel, 'chat_messages', index: 1)!['chat_query'], {
|
expect(requestOf(channel, 'chat_messages', index: 1)!['chat_query'], {
|
||||||
'session_id': 'target',
|
'session_id': 'target',
|
||||||
'limit': 200,
|
'limit': 200,
|
||||||
'cursor': '',
|
'cursor': '',
|
||||||
});
|
});
|
||||||
expect(find.text('The notified chat.'), findsOneWidget);
|
expect(find.text('The notified chat.'), findsOneWidget);
|
||||||
expect(find.text('The retained chat.'), findsNothing);
|
expect(find.text('The retained chat.'), findsNothing);
|
||||||
expect(provider.value.uri.path, '/chat/target');
|
expect(provider.value.uri.path, '/chat/target');
|
||||||
|
|
||||||
await tester.pumpWidget(const SizedBox.shrink());
|
await tester.pumpWidget(const SizedBox.shrink());
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
},
|
});
|
||||||
);
|
|
||||||
|
|
||||||
testWidgets(
|
testWidgets(
|
||||||
'mobile Chats retap reopens the retained multi-pane workspace after tabs',
|
'mobile Chats retap reopens the retained multi-pane workspace after tabs',
|
||||||
@@ -496,7 +515,8 @@ void main() {
|
|||||||
await tester.pump();
|
await tester.pump();
|
||||||
expect(provider.value.uri.path, '/chat/a');
|
expect(provider.value.uri.path, '/chat/a');
|
||||||
expect(find.byType(ChatThreadView), findsOneWidget);
|
expect(find.byType(ChatThreadView), findsOneWidget);
|
||||||
await replyChatSessions(tester, channel, ['a', 'b'], index: 1);
|
// The keyed session list moves beside the chat without remounting, so
|
||||||
|
// opening a chat issues no second list read.
|
||||||
await replyChatHistory(
|
await replyChatHistory(
|
||||||
tester,
|
tester,
|
||||||
channel,
|
channel,
|
||||||
|
|||||||
@@ -124,10 +124,12 @@ void main() {
|
|||||||
reason:
|
reason:
|
||||||
'The main-screen Back interceptor must not block an open chat',
|
'The main-screen Back interceptor must not block an open chat',
|
||||||
);
|
);
|
||||||
|
// The visible Back closes the chat page's own route explicitly (the
|
||||||
|
// same path the system gesture takes), never the nearest route.
|
||||||
expect(
|
expect(
|
||||||
tester.widget<BackButton>(findNativeBack()).onPressed,
|
tester.widget<BackButton>(findNativeBack()).onPressed,
|
||||||
isNull,
|
isNotNull,
|
||||||
reason: 'Use the stock Navigator Back action without a chat override',
|
reason: 'Back pops the chat page itself, not whichever route is near',
|
||||||
);
|
);
|
||||||
final transcript = find.byKey(const ValueKey('chat-thread-s'));
|
final transcript = find.byKey(const ValueKey('chat-thread-s'));
|
||||||
final scroll = tester
|
final scroll = tester
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import 'package:pipelines_app/application/pipelines_app.dart';
|
|||||||
import 'package:pipelines_app/application/server_endpoint.dart';
|
import 'package:pipelines_app/application/server_endpoint.dart';
|
||||||
import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
import 'package:pipelines_app/core/transport/pipelines_client.dart';
|
||||||
import 'package:pipelines_app/features/pipelines/screen.dart';
|
import 'package:pipelines_app/features/pipelines/screen.dart';
|
||||||
|
import 'package:pipelines_app/features/walkthrough/walkthrough_store.dart';
|
||||||
|
|
||||||
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
||||||
import '../features/pipelines/fixtures.dart';
|
import '../features/pipelines/fixtures.dart';
|
||||||
@@ -21,6 +22,15 @@ ServerEndpoint webServer() => ServerEndpoint.resolve(
|
|||||||
web: true,
|
web: true,
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/// Preferences for a device that has finished the first-run walkthrough and
|
||||||
|
/// was already offered it for [webServer]. With them the Pipelines page shows
|
||||||
|
/// no walkthrough dialog over its rows and bar, and issues no empty-server
|
||||||
|
/// check (whose unanswered reads would hold the serialized request queue).
|
||||||
|
Map<String, Object> walkthroughDonePreferences() => {
|
||||||
|
walkthroughSeenKey: true,
|
||||||
|
walkthroughOfferedKey: <String>[webServer().uri.toString()],
|
||||||
|
};
|
||||||
|
|
||||||
Map<String, dynamic>? requestOf(FakeChannel channel, String type) => channel
|
Map<String, dynamic>? requestOf(FakeChannel channel, String type) => channel
|
||||||
.outgoing
|
.outgoing
|
||||||
.map((frame) => jsonDecode(frame as String) as Map<String, dynamic>)
|
.map((frame) => jsonDecode(frame as String) as Map<String, dynamic>)
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import 'package:pipelines_app/features/pipelines/ui/run_pipeline_wording.dart';
|
|||||||
|
|
||||||
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
||||||
import '../features/pipelines/fixtures.dart';
|
import '../features/pipelines/fixtures.dart';
|
||||||
import 'pipelines_app_test.dart' show webServer;
|
import 'pipelines_app_test.dart' show walkthroughDonePreferences, webServer;
|
||||||
import 'pipelines_replies.dart';
|
import 'pipelines_replies.dart';
|
||||||
|
|
||||||
List<Map<String, dynamic>> requestsOf(FakeChannel channel, String type) =>
|
List<Map<String, dynamic>> requestsOf(FakeChannel channel, String type) =>
|
||||||
@@ -55,7 +55,11 @@ Future<void> reply(
|
|||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
// The Run dialog reads the device's pending launch store before it opens.
|
// The Run dialog reads the device's pending launch store before it opens.
|
||||||
setUp(() => SharedPreferences.setMockInitialValues({}));
|
// A device that has seen the first-run walkthrough has no dialog over the
|
||||||
|
// Pipelines page to absorb the row taps.
|
||||||
|
setUp(
|
||||||
|
() => SharedPreferences.setMockInitialValues(walkthroughDonePreferences()),
|
||||||
|
);
|
||||||
testWidgets('an accepted launch opens the returned run and re-reads the '
|
testWidgets('an accepted launch opens the returned run and re-reads the '
|
||||||
'runs list exactly once', (tester) async {
|
'runs list exactly once', (tester) async {
|
||||||
tester.view.physicalSize = const Size(1100, 900);
|
tester.view.physicalSize = const Size(1100, 900);
|
||||||
|
|||||||
@@ -560,7 +560,8 @@ void main() {
|
|||||||
expect(find.byType(ArtifactViewerPage), findsOneWidget);
|
expect(find.byType(ArtifactViewerPage), findsOneWidget);
|
||||||
|
|
||||||
// Leave the viewer for the Artifacts tab, then a retired field hit opens
|
// Leave the viewer for the Artifacts tab, then a retired field hit opens
|
||||||
// the plain Summary with no visit.
|
// the plain Summary with no visit, in its default sections (Output open,
|
||||||
|
// Input closed).
|
||||||
await closeViewer(tester);
|
await closeViewer(tester);
|
||||||
expectArtifactsTabSelecting(tester, '/artifacts/7/2/report.txt');
|
expectArtifactsTabSelecting(tester, '/artifacts/7/2/report.txt');
|
||||||
await sendSearch(query: 'retired', index: 1, hit: retiredFieldHit());
|
await sendSearch(query: 'retired', index: 1, hit: retiredFieldHit());
|
||||||
@@ -579,6 +580,17 @@ void main() {
|
|||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
expect(find.text('ship it'), findsNothing);
|
expect(find.text('ship it'), findsNothing);
|
||||||
|
expect(find.text('ok'), findsOneWidget);
|
||||||
|
|
||||||
|
// The operator closes Output, so the next hit must reopen it itself.
|
||||||
|
final outputTitle = find.descendant(
|
||||||
|
of: find.byKey(const ValueKey('run-detail-summary-output')),
|
||||||
|
matching: find.text('Output'),
|
||||||
|
);
|
||||||
|
await tester.ensureVisible(outputTitle.first);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(outputTitle.first);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
expect(find.text('ok'), findsNothing);
|
expect(find.text('ok'), findsNothing);
|
||||||
|
|
||||||
// A current field hit opens the same run at the Summary section holding the
|
// A current field hit opens the same run at the Summary section holding the
|
||||||
@@ -710,12 +722,16 @@ void main() {
|
|||||||
await replyRunDetailFor(tester, channel, searchSelectionDetail(), index: 1);
|
await replyRunDetailFor(tester, channel, searchSelectionDetail(), index: 1);
|
||||||
await tester.pumpAndSettle();
|
await tester.pumpAndSettle();
|
||||||
|
|
||||||
|
expect(find.byType(ArtifactViewerPage), findsNothing);
|
||||||
expect(find.byKey(const Key('run-visit-pane')), findsNothing);
|
expect(find.byKey(const Key('run-visit-pane')), findsNothing);
|
||||||
expect(
|
expect(
|
||||||
find.byKey(const Key('run-detail-tab-body-summary')),
|
find.byKey(const Key('run-detail-tab-body-summary')),
|
||||||
findsOneWidget,
|
findsOneWidget,
|
||||||
);
|
);
|
||||||
expect(find.text('ok'), findsNothing);
|
// An ordinary visit shows the Summary's default sections: Output open,
|
||||||
|
// Input closed.
|
||||||
|
expect(find.text('ok'), findsOneWidget);
|
||||||
|
expect(find.text('ship it'), findsNothing);
|
||||||
|
|
||||||
await tester.pumpWidget(const SizedBox.shrink());
|
await tester.pumpWidget(const SizedBox.shrink());
|
||||||
await tester.pump();
|
await tester.pump();
|
||||||
|
|||||||
@@ -9,13 +9,16 @@ import 'package:shared_preferences/shared_preferences.dart';
|
|||||||
|
|
||||||
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
|
||||||
import '../features/pipelines/fixtures.dart';
|
import '../features/pipelines/fixtures.dart';
|
||||||
import 'pipelines_app_test.dart' show webServer, requestOf;
|
import 'pipelines_app_test.dart'
|
||||||
|
show walkthroughDonePreferences, webServer, requestOf;
|
||||||
import 'pipelines_replies.dart';
|
import 'pipelines_replies.dart';
|
||||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
testWidgets('Settings shares socket and one native bar', (tester) async {
|
testWidgets('Settings shares socket and one native bar', (tester) async {
|
||||||
SharedPreferences.setMockInitialValues({});
|
// A device that has seen the first-run walkthrough: no dialog over the
|
||||||
|
// Pipelines page absorbs the bar tap.
|
||||||
|
SharedPreferences.setMockInitialValues(walkthroughDonePreferences());
|
||||||
final channel = FakeChannel()..readyCompleter.complete();
|
final channel = FakeChannel()..readyCompleter.complete();
|
||||||
var sockets = 0;
|
var sockets = 0;
|
||||||
final client = PipelinesClient(
|
final client = PipelinesClient(
|
||||||
|
|||||||
@@ -230,6 +230,22 @@ void main() {
|
|||||||
expect(tester.takeException(), isNull);
|
expect(tester.takeException(), isNull);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
testWidgets('a short wide window scrolls the jump index to its last link', (
|
||||||
|
tester,
|
||||||
|
) async {
|
||||||
|
// More links than a 600 px tall index fits: it must scroll, not overflow.
|
||||||
|
await _pump(tester, _filler(30), size: const Size(1200, 600));
|
||||||
|
expect(tester.takeException(), isNull);
|
||||||
|
|
||||||
|
final last = find.byKey(const ValueKey('settings.index.filler-29'));
|
||||||
|
await tester.ensureVisible(last);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
await tester.tap(last);
|
||||||
|
await tester.pumpAndSettle();
|
||||||
|
expect(find.text('Filler 29'), findsWidgets);
|
||||||
|
expect(tester.takeException(), isNull);
|
||||||
|
});
|
||||||
|
|
||||||
testWidgets('a narrow layout has no jump index', (tester) async {
|
testWidgets('a narrow layout has no jump index', (tester) async {
|
||||||
await _pump(tester, [
|
await _pump(tester, [
|
||||||
SettingsSection(
|
SettingsSection(
|
||||||
|
|||||||
Reference in New Issue
Block a user