545291e04a
- Run rows show a failed run's reason (else its diagnostic's first line, full text in a tooltip) or a short result preview; the Summary leads with "Why it failed". - Run again for succeeded/canceled/interrupted runs opens the New run form pre-filled (prompt, workspace, report format) at the latest version with the original offered. - Run detail and stage tabs show their names; touch shows captions on the Runs header and artifact viewer actions (desktop keeps tooltips). - ErrorNotice maps not connected / server too old / permission / timeout to what to do, raw detail behind Details (Schedules, create chat, Runs, Pipelines banners). - Settings has no Back arrow; Schedules keeps the rail on wide windows; phone Settings leads with Connection and Notifications and has a Jump to topic menu. - Walkthrough: Open Connection (skipped when connected), labelled Copy. - Pluralised counts; no duplicate status/rail names for screen readers. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
83 lines
2.9 KiB
Dart
83 lines
2.9 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/ui/navigation/labelled_icon_button.dart';
|
|
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_body.dart';
|
|
import 'package:pipelines_app/features/changes/widgets/diff_form_control.dart';
|
|
|
|
void main() {
|
|
for (final width in [400.0, 1000.0]) {
|
|
testWidgets('diff choices adapt to app width $width', (tester) async {
|
|
tester.view.physicalSize = Size(width, 900);
|
|
tester.view.devicePixelRatio = 1;
|
|
addTearDown(tester.view.reset);
|
|
DiffForm? selected;
|
|
await tester.pumpWidget(
|
|
MaterialApp(
|
|
home: Scaffold(
|
|
body: Align(
|
|
alignment: Alignment.topLeft,
|
|
child: Builder(
|
|
builder: (context) => diffFormMenu(
|
|
context,
|
|
form: DiffForm.rendered,
|
|
onChanged: (value) => selected = value,
|
|
),
|
|
),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
await tester.tap(find.byTooltip('Diff form'));
|
|
await tester.pumpAndSettle();
|
|
expect(
|
|
find.byType(BottomSheet),
|
|
width < 600 ? findsOneWidget : findsNothing,
|
|
);
|
|
expect(
|
|
find.byKey(const ValueKey('app-choice-menu')),
|
|
width >= 600 ? findsOneWidget : findsNothing,
|
|
);
|
|
await tester.tap(find.text('Raw patch'));
|
|
await tester.pumpAndSettle();
|
|
expect(selected, DiffForm.raw);
|
|
expect(find.text('Raw patch'), findsNothing);
|
|
expect(tester.takeException(), isNull);
|
|
});
|
|
|
|
testWidgets('artifact details adapt to app width $width', (tester) async {
|
|
tester.view.physicalSize = Size(width, 900);
|
|
tester.view.devicePixelRatio = 1;
|
|
addTearDown(tester.view.reset);
|
|
await tester.pumpWidget(
|
|
const MaterialApp(
|
|
home: Scaffold(
|
|
body: ArtifactViewerInfoAction(
|
|
facts: Text('Recorded artifact facts'),
|
|
),
|
|
),
|
|
),
|
|
);
|
|
// A tooltip on desktop; a caption under the icon on touch.
|
|
await tester.tap(
|
|
find.byWidgetPredicate(
|
|
(widget) =>
|
|
(widget is Tooltip && widget.message == 'Details') ||
|
|
(widget is LabelledIconButton && widget.label == 'Details'),
|
|
),
|
|
);
|
|
await tester.pumpAndSettle();
|
|
expect(find.text('Recorded artifact facts'), findsOneWidget);
|
|
expect(find.byType(Dialog), width >= 600 ? findsOneWidget : findsNothing);
|
|
expect(
|
|
find.byType(BottomSheet),
|
|
width < 600 ? findsOneWidget : findsNothing,
|
|
);
|
|
final context = tester.element(find.text('Recorded artifact facts'));
|
|
Navigator.of(context).pop();
|
|
await tester.pumpAndSettle();
|
|
expect(find.text('Recorded artifact facts'), findsNothing);
|
|
expect(tester.takeException(), isNull);
|
|
});
|
|
}
|
|
}
|