feat(app): a timeline visit shows its own changes as a Changes section
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:flutter/widgets.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/core/api_gateway.dart';
|
||||
import 'package:pipelines_app/features/changes/changes.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_changes_action.dart';
|
||||
import 'package:pipelines_app/features/runs/ui/run_detail_visit_sections.dart';
|
||||
|
||||
import '../../changes/fixtures.dart';
|
||||
import 'run_detail_graph_support.dart';
|
||||
@@ -26,10 +27,9 @@ JsonMap _capture(String path) => captureFixture(
|
||||
files: <JsonMap>[fileChangeFixture(path: path, patch: multiHunkPatch)],
|
||||
);
|
||||
|
||||
Future<void> _openVisitChanges(WidgetTester tester) async {
|
||||
await tester.tap(find.byKey(runVisitChangesButtonKey));
|
||||
await tester.pumpAndSettle();
|
||||
}
|
||||
/// A visit's own changes are a section of its pane, not a separate page.
|
||||
Future<void> _openVisitChanges(WidgetTester tester) =>
|
||||
openVisitTab(tester, RunVisitSection.changes);
|
||||
|
||||
void main() {
|
||||
group('visitChangesTitle', () {
|
||||
@@ -64,7 +64,7 @@ void main() {
|
||||
|
||||
await _openVisitChanges(tester);
|
||||
|
||||
expect(find.text('Changes · plan · visit 1'), findsOneWidget);
|
||||
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
||||
// The body keeps the landed viewer's own identity for that visit.
|
||||
expect(find.text('plan'), findsOneWidget);
|
||||
expect(find.text('Visit 1 · completed'), findsOneWidget);
|
||||
@@ -83,7 +83,7 @@ void main() {
|
||||
|
||||
await _openVisitChanges(tester);
|
||||
|
||||
expect(find.text('Changes · plan · visit 1'), findsOneWidget);
|
||||
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
||||
expect(find.text(missingCaptureDetail), findsOneWidget);
|
||||
// A missing capture is evidence, never an observed no-change.
|
||||
expect(find.text('No changes observed'), findsNothing);
|
||||
@@ -91,38 +91,4 @@ void main() {
|
||||
expect(find.text('lib/build.dart'), findsNothing);
|
||||
});
|
||||
}
|
||||
|
||||
testWidgets('material: visit Changes returns to the opened pane', (
|
||||
tester,
|
||||
) async {
|
||||
await openVisit(
|
||||
tester,
|
||||
RunDetailTestPlatform.material,
|
||||
run: _run(planChanges: _capture('lib/plan.dart')),
|
||||
);
|
||||
|
||||
await _openVisitChanges(tester);
|
||||
await tester.tap(find.byTooltip('Back'));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
||||
expect(find.byKey(runVisitChangesButtonKey), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('cupertino: visit Changes returns to the opened pane', (
|
||||
tester,
|
||||
) async {
|
||||
await openVisit(
|
||||
tester,
|
||||
RunDetailTestPlatform.cupertino,
|
||||
run: _run(planChanges: _capture('lib/plan.dart')),
|
||||
);
|
||||
|
||||
await _openVisitChanges(tester);
|
||||
await tester.tap(find.byType(CupertinoNavigationBarBackButton));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
||||
expect(find.byKey(runVisitChangesButtonKey), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user