fe24f228fe
Review r2 findings P2-4, P2-5, P3-13: a shared relative-time helper for
every list row's time, formatDuration switches to days past 24h ('9d
16h'), the stage page uses one visit numbering, drops a repeated stage
heading and fixes '1 files', and search run hits read 'Run 1'.
Implemented by pipeline run #205/#207 (Terra); its UIReview blocked on a
fixture without timestamps, verified by the manager.
33 lines
1.2 KiB
Dart
33 lines
1.2 KiB
Dart
import 'package:flutter/widgets.dart';
|
|
import 'package:flutter_test/flutter_test.dart';
|
|
import 'package:pipelines_app/features/runs/ui/run_detail_view.dart';
|
|
import 'package:pipelines_app/shell/detail_page.dart';
|
|
|
|
/// Wide screens deliberately repeat the selected title in the visible list.
|
|
/// The run's title is in its top bar: the detail pane's (or page's) when the
|
|
/// detail sits in one, else the run detail's own.
|
|
Finder runDetailText(String text) => find.descendant(
|
|
of: find.byWidgetPredicate(
|
|
(widget) => widget is RunDetailView || widget is DetailPane,
|
|
),
|
|
matching: find.text(text),
|
|
);
|
|
|
|
/// The stage page's bar names the stage over its visit (and run): the title
|
|
/// is keyed `run-visit-title` and the subtitle starts `Visit <stage visit>`.
|
|
void expectVisitHeading(WidgetTester tester, String stage, num visit) {
|
|
expect(find.byKey(const Key('run-visit-pane')), findsOneWidget);
|
|
final heading = find.byKey(const Key('run-visit-title'));
|
|
expect(
|
|
find.descendant(of: heading, matching: find.text(stage)),
|
|
findsOneWidget,
|
|
);
|
|
expect(
|
|
find.descendant(
|
|
of: heading,
|
|
matching: find.textContaining(RegExp('^Visit $visit( ·|\$)')),
|
|
),
|
|
findsOneWidget,
|
|
);
|
|
}
|