Merge branch 'run/artifacts-collapsed' into integrate/bars-artifacts
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,
|
||||
),
|
||||
),
|
||||
),
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user