Files
pipelines/app/test/application/pipelines_registration_test.dart
alan 9551eceaed Complete Material-only APIs and fixtures
Remove obsolete control-family flags and icon metadata across all callers, dead alternate themes and host helpers, obsolete test setup, and the unused icon-font dependency. Preserve native Material Back transitions. Make navigation fixtures independent of update plugins and answer auxiliary shell snapshots so the complete application suite can run deterministically.
2026-11-11 21:55:39 +00:00

75 lines
2.5 KiB
Dart

import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/application/pipelines_app.dart';
import 'package:pipelines_app/core/transport/pipelines_client.dart';
import '../core/transport/pipelines_client_test.dart' show FakeChannel;
import '../features/pipelines/fixtures.dart';
import '../features/pipelines/test_helpers.dart' show selectableText;
import 'pipelines_app_test.dart' show webServer;
import 'pipelines_replies.dart';
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
void main() {
testWidgets('the /pipelines route renders real rows, detail and source', (
tester,
) async {
tester.view.physicalSize = const Size(1100, 900);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.resetPhysicalSize);
addTearDown(tester.view.resetDevicePixelRatio);
final fixture = PipelineFixture();
final channel = FakeChannel()..readyCompleter.complete();
var sockets = 0;
final client = PipelinesClient(
channelFactory: (_) {
sockets++;
return channel;
},
);
final provider = PlatformRouteInformationProvider(
initialRouteInformation: RouteInformation(uri: Uri.parse('/pipelines')),
);
addTearDown(provider.dispose);
await tester.pumpWidget(
PipelinesApp(
androidSupported: false,
server: webServer(),
client: client,
routeInformationProvider: provider,
),
);
await tester.pump();
await replyPipelines(tester, channel, fixture);
await tester.pump();
expect(find.text('Alpha review'), findsOneWidget);
expect(find.text('2 stages · 1 schedule'), findsOneWidget);
expect(find.text('Pipelines — Not implemented'), findsNothing);
expect(sockets, 1);
// The shell owns the only navigation bar; the embedded screen adds no
// second bar.
expect(find.byType(SegmentedBar), findsOneWidget);
expect(find.byType(Scaffold), findsOneWidget);
await tester.tap(find.byKey(const Key('pipeline-row-1')));
await tester.pump();
await replyPipelineDetail(tester, channel, fixture);
await tester.pump();
expect(find.text('hash-alpha'), findsOneWidget);
await tester.tap(find.byKey(const Key('pipeline-detail-tab-source')));
await tester.pump();
expect(
selectableText('name: Alpha review\nstages:\n review:\n type: model'),
findsOneWidget,
);
await tester.pumpWidget(const SizedBox.shrink());
await tester.pump();
});
}