9bdabb32d9
Keep the Material-only shell path while preserving public cupertino parameters for callers. Narrow matching tests to Material hosts and behavior because the app always runs under MaterialApp.
26 lines
932 B
Dart
26 lines
932 B
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/shell/shell_destination_menu.dart';
|
|
import 'package:pipelines_app/shell/destination.dart';
|
|
|
|
void main() {
|
|
testWidgets('compact menu exposes all named destinations', (tester) async {
|
|
AppDestination? selected;
|
|
final menu = ShellDestinationMenu(
|
|
cupertino: false,
|
|
current: AppDestination.chat,
|
|
onSelected: (value) => selected = value,
|
|
);
|
|
await tester.pumpWidget(MaterialApp(home: Scaffold(body: menu)));
|
|
await tester.tap(find.text('Menu'));
|
|
await tester.pumpAndSettle();
|
|
for (final name in ['Pipelines', 'Runs', 'Chat', 'Search', 'Settings']) {
|
|
expect(find.text(name), findsOneWidget);
|
|
}
|
|
await tester.tap(find.text('Runs'));
|
|
await tester.pumpAndSettle();
|
|
expect(selected, AppDestination.runs);
|
|
expect(tester.takeException(), isNull);
|
|
});
|
|
}
|