Sheets, decision options, usage, settings and artifact errors: review r2 batches H and L
Shared AppSheetHeader (title + Done) for the Runs filter/sort and Needs you sheets; Runs filter single-choice groups as check rows and statuses in sentence case; Cupertino decision options as a check list; run action sheet titled with the run; usage page without the duplicate title and with honest empty states; Settings Reconnect wording, compact notifications row and a tinted Cupertino Save workspace; friendly artifact preview failures with Retry.
This commit is contained in:
@@ -12,6 +12,8 @@ import 'package:pipelines_app/features/artifacts/domain/artifact_groups.dart';
|
||||
import 'package:pipelines_app/features/artifacts/domain/artifact_record.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_external_open.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_gallery_page.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_content.dart'
|
||||
show artifactPreviewRetryKey;
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_fetch.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_viewer_page.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_visit_list.dart';
|
||||
@@ -464,8 +466,39 @@ void main() {
|
||||
|
||||
pending.complete(ArtifactFetchResult(status: 404, bytes: Uint8List(0)));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.text('The server answered 404.'), findsOneWidget);
|
||||
expect(find.text('This file is no longer on the server.'), findsOneWidget);
|
||||
expect(find.textContaining('answered'), findsNothing);
|
||||
expect(find.byType(SelectableText), findsNothing);
|
||||
expect(find.byKey(artifactPreviewRetryKey), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Retry fetches a failed preview again', (tester) async {
|
||||
final text = recordedArtifact(
|
||||
'notes.txt',
|
||||
url: '/artifacts/1/1/notes.txt',
|
||||
contentType: 'text/plain',
|
||||
);
|
||||
final group = _group([text]);
|
||||
var calls = 0;
|
||||
await _pumpViewer(
|
||||
tester,
|
||||
groups: [group],
|
||||
selected: artifactVisitIdentity(group, text),
|
||||
fetch: (_) async {
|
||||
calls++;
|
||||
if (calls == 1) throw const ArtifactFetchException('network down');
|
||||
return ArtifactFetchResult(
|
||||
status: 200,
|
||||
bytes: Uint8List.fromList('hello'.codeUnits),
|
||||
);
|
||||
},
|
||||
);
|
||||
expect(find.byKey(artifactPreviewRetryKey), findsOneWidget);
|
||||
await tester.tap(find.byKey(artifactPreviewRetryKey));
|
||||
await tester.pumpAndSettle();
|
||||
expect(calls, 2);
|
||||
expect(find.byKey(artifactPreviewRetryKey), findsNothing);
|
||||
expect(find.text('hello'), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('a network failure is reported instead of an empty preview', (
|
||||
@@ -483,8 +516,15 @@ void main() {
|
||||
selected: artifactVisitIdentity(group, text),
|
||||
fetch: (_) async => throw const ArtifactFetchException('network down'),
|
||||
);
|
||||
expect(find.textContaining('Could not load preview'), findsOneWidget);
|
||||
expect(find.textContaining('network down'), findsOneWidget);
|
||||
// A friendly line with Retry, never the raw exception text.
|
||||
expect(
|
||||
find.text(
|
||||
'The preview could not be loaded. Check the connection and try again.',
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(find.textContaining('network down'), findsNothing);
|
||||
expect(find.byKey(artifactPreviewRetryKey), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('Cupertino draws the same text preview and controls', (
|
||||
|
||||
Reference in New Issue
Block a user