Merge branch 'main' into run/lists-polish-r1
This commit is contained in:
@@ -65,6 +65,7 @@ Widget artifactListHost({
|
||||
groups: groups,
|
||||
selectedIdentity: selectedIdentity,
|
||||
onSelected: onSelected,
|
||||
initiallyCollapsed: false,
|
||||
);
|
||||
Widget scaled(BuildContext context, Widget? child) => MediaQuery(
|
||||
data: MediaQuery.of(
|
||||
|
||||
@@ -1,13 +1,41 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/artifacts/ui/artifact_tile.dart';
|
||||
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_visit_list.dart';
|
||||
import 'package:pipelines_app/ui/layout/sticky_section.dart';
|
||||
|
||||
import 'artifact_visit_list_fixture.dart';
|
||||
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
testWidgets(
|
||||
'${cupertino ? 'Cupertino' : 'Material'} artifact groups start collapsed and expand',
|
||||
(tester) async {
|
||||
final group = visitGroup(artifacts: [recordedArtifact('result.csv')]);
|
||||
await tester.pumpWidget(
|
||||
cupertino
|
||||
? CupertinoApp(
|
||||
home: CupertinoPageScaffold(
|
||||
child: ArtifactVisitList(groups: [group]),
|
||||
),
|
||||
)
|
||||
: MaterialApp(
|
||||
home: Scaffold(body: ArtifactVisitList(groups: [group])),
|
||||
),
|
||||
);
|
||||
expect(find.byType(ArtifactTile), findsNothing);
|
||||
expect(find.bySemanticsLabel('review · visit 1'), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byType(StickySectionTitle));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byType(ArtifactTile), findsOneWidget);
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
test('a shared filename in two visits has distinct identities', () {
|
||||
const url = '/artifacts/7/result.csv';
|
||||
final first = visitGroup(
|
||||
@@ -248,6 +276,7 @@ void main() {
|
||||
body: ArtifactVisitList(
|
||||
groups: [group],
|
||||
header: const Text('Artifacts · 1 recorded'),
|
||||
initiallyCollapsed: false,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -281,7 +281,14 @@ void main() {
|
||||
// Drag like an operator: a programmatic scroll is undone by the
|
||||
// view's follow-to-latest, while a user drag stops following.
|
||||
final list = find.byKey(const ValueKey<String>('chat-thread-s'));
|
||||
final viewport = tester.getRect(list);
|
||||
// The transcript scrolls behind the floating header; only the part
|
||||
// below it is visible.
|
||||
final viewport = Rect.fromLTRB(
|
||||
tester.getRect(list).left,
|
||||
tester.getRect(find.byKey(const Key('chat-thread-header'))).bottom,
|
||||
tester.getRect(list).right,
|
||||
tester.getRect(list).bottom,
|
||||
);
|
||||
for (var i = 0; i < 10; i++) {
|
||||
final rect = tester.getRect(control);
|
||||
if (rect.top >= viewport.top && rect.bottom <= viewport.bottom) break;
|
||||
|
||||
@@ -90,6 +90,11 @@ void main() {
|
||||
find.byKey(const Key('chat-attachment-thumbnail-image')),
|
||||
findsOneWidget,
|
||||
);
|
||||
// A hairline frames the image so it reads against the page.
|
||||
final frame = tester.widget<Container>(
|
||||
find.byKey(const Key('chat-attachment-frame')),
|
||||
);
|
||||
expect((frame.foregroundDecoration as BoxDecoration).border, isNotNull);
|
||||
// No paperclip row and no base64 shown as a file name.
|
||||
expect(find.byIcon(Icons.attach_file), findsNothing);
|
||||
expect(find.byIcon(CupertinoIcons.paperclip), findsNothing);
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/graph/domain/stage_definition.dart';
|
||||
import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
JsonMap _graph() => <String, dynamic>{
|
||||
'stages': <dynamic>[
|
||||
@@ -174,7 +175,7 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(_text('plan definition'), findsOneWidget);
|
||||
expect(find.byType(AppBar), findsOneWidget);
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
expect(find.byType(BackButton), findsOneWidget);
|
||||
final route = ModalRoute.of(
|
||||
tester.element(find.byType(StageDefinitionView)),
|
||||
@@ -215,7 +216,7 @@ void main() {
|
||||
|
||||
expect(_text('Success definition'), findsOneWidget);
|
||||
expect(_text('#success definition'), findsNothing);
|
||||
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
expect(find.byType(CupertinoNavigationBarBackButton), findsOneWidget);
|
||||
expect(_text('Incoming routes'), findsOneWidget);
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/runs/data/runs_repository.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/runs_controller.dart';
|
||||
import 'package:pipelines_app/ui/layout/sticky_section.dart';
|
||||
|
||||
import '../../artifacts/domain/artifact_fixtures.dart';
|
||||
|
||||
@@ -113,6 +114,11 @@ void main() {
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const ValueKey('run-detail-tab-artifacts')));
|
||||
await tester.pumpAndSettle();
|
||||
final sections = find.byType(StickySectionTitle);
|
||||
for (var index = 0; index < sections.evaluate().length; index += 1) {
|
||||
await tester.tap(sections.at(index));
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.text('Artifacts · 2 recorded'), findsOneWidget);
|
||||
expect(find.text('build.log'), findsOneWidget);
|
||||
|
||||
@@ -6,10 +6,19 @@ import 'package:pipelines_app/features/graph/widgets/stage_definition_view.dart'
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_facts.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_sections.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_session_state.dart';
|
||||
import 'package:pipelines_app/ui/layout/sticky_section.dart';
|
||||
|
||||
import 'run_detail_graph_support.dart';
|
||||
import 'run_detail_visit_support.dart';
|
||||
|
||||
Future<void> _expandArtifactGroup(WidgetTester tester) async {
|
||||
final sections = find.byType(StickySectionTitle);
|
||||
for (var index = 0; index < sections.evaluate().length; index += 1) {
|
||||
await tester.tap(sections.at(index));
|
||||
}
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
|
||||
void main() {
|
||||
for (final platform in RunDetailTestPlatform.values) {
|
||||
testWidgets('${platform.name} stage tabs sit at the bottom with one Back', (
|
||||
@@ -71,6 +80,7 @@ void main() {
|
||||
await openVisitTab(tester, RunVisitSection.artifacts);
|
||||
// The section is the run's gallery, focused on this visit: exactly the
|
||||
// stage's files, without the session evidence file.
|
||||
await _expandArtifactGroup(tester);
|
||||
expect(find.byType(ArtifactGalleryPage), findsOneWidget);
|
||||
expect(find.text('plan.csv'), findsOneWidget);
|
||||
expect(find.text('session.html'), findsNothing);
|
||||
@@ -185,6 +195,7 @@ void main() {
|
||||
await openVisit(tester, platform, run: run, sequence: 2);
|
||||
expectVisitHeading(tester, 'plan', 2);
|
||||
await openVisitTab(tester, RunVisitSection.artifacts);
|
||||
await _expandArtifactGroup(tester);
|
||||
expect(find.text('plan-2.csv'), findsOneWidget);
|
||||
expect(find.text('public/shared.csv'), findsNothing);
|
||||
expect(find.byType(ArtifactGalleryPage), findsOneWidget);
|
||||
|
||||
@@ -8,6 +8,7 @@ import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/runs/screen.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
|
||||
import 'run_detail_finders.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
class _Gateway implements ApiGateway {
|
||||
final framesController = StreamController<JsonMap>.broadcast();
|
||||
@@ -310,7 +311,9 @@ void main() {
|
||||
await _mountList(tester, gateway);
|
||||
|
||||
expect(find.byType(CupertinoPageScaffold), findsNWidgets(2));
|
||||
expect(find.byType(CupertinoNavigationBar), findsNWidgets(2));
|
||||
// The host's own bar and the detail pane's segmented bar.
|
||||
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
expect(find.text('Loading run details…'), findsOneWidget);
|
||||
expect(find.byType(CupertinoActivityIndicator), findsOneWidget);
|
||||
expect(find.text('Back to list'), findsOneWidget);
|
||||
|
||||
@@ -10,6 +10,7 @@ import 'package:pipelines_app/features/settings/settings_screen.dart';
|
||||
import 'package:pipelines_app/features/settings/settings_store.dart';
|
||||
|
||||
import 'fake_channel.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('renders idle settings without opening a connection', (
|
||||
@@ -241,7 +242,7 @@ void main() {
|
||||
|
||||
await _pump(tester, client, platform: TargetPlatform.iOS);
|
||||
|
||||
expect(find.byType(CupertinoNavigationBar), findsOneWidget);
|
||||
expect(find.byType(SegmentedBar), findsOneWidget);
|
||||
expect(find.byType(CupertinoTextField), findsNWidgets(2));
|
||||
expect(find.byType(TextField), findsNothing);
|
||||
expect(find.byType(FilledButton), findsNothing);
|
||||
|
||||
@@ -9,6 +9,7 @@ import 'package:pipelines_app/features/templates/ui/template_detail.dart';
|
||||
|
||||
import '../data/template_test_support.dart' show source;
|
||||
import 'template_gallery_test_support.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/segmented_bar.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('loading shows the exact line, then the server catalogue', (
|
||||
@@ -210,7 +211,7 @@ void main() {
|
||||
);
|
||||
await pumpGallery(tester, gateway, embedded: true);
|
||||
|
||||
expect(find.byType(AppBar), findsNothing);
|
||||
expect(find.byType(SegmentedBar), findsNothing);
|
||||
expect(find.byKey(templatesRefreshKey), findsOneWidget);
|
||||
await tester.tap(find.byKey(templateRowKey('release')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
Reference in New Issue
Block a user