Merge branch 'main' into run/floating-tabs

This commit is contained in:
2026-10-31 01:04:45 +00:00
12 changed files with 233 additions and 65 deletions
@@ -165,11 +165,13 @@ void main() {
await pumpApp(tester, provider: provider, client: client);
await waitForRequest(tester, channel, 'list_runs');
final initialRuns = pipelineRequest(channel, 'list_runs')!;
channel.incoming.add(jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}));
channel.incoming.add(
jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}),
);
await tester.pump();
final before = countType(channel, 'list_runs');
showDialog<void>(
@@ -198,11 +200,13 @@ void main() {
await pumpApp(tester, provider: provider, client: client);
await waitForRequest(tester, channel, 'list_runs');
final initialRuns = pipelineRequest(channel, 'list_runs')!;
channel.incoming.add(jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}));
channel.incoming.add(
jsonEncode({
'id': initialRuns['id'],
'type': 'runs',
'runs': PipelineFixture().runs,
}),
);
await tester.pump();
final before = countType(channel, 'list_runs');
showDialog<void>(
@@ -23,10 +23,18 @@ void main() {
// Filter and sort are app-bar actions; no toolbar row without a filter.
expect(find.byKey(const Key('pipeline-toolbar')), findsNothing);
// A native leading flow icon gives each pipeline a durable identity while
// the title follows its normal ListTile spacing.
expect(find.byIcon(Icons.account_tree_outlined), findsNWidgets(3));
expect(
tester.getTopLeft(find.text('Alpha review')).dx - listLeft,
tester.getTopLeft(find.byIcon(Icons.account_tree_outlined).first).dx -
listLeft,
kPipelineListInset,
);
expect(
tester.getTopLeft(find.text('Alpha review')).dx,
greaterThan(listLeft),
);
expect(
find.descendant(of: list, matching: find.byType(Divider)),
@@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:pipelines_app/core/api_gateway.dart';
import 'package:pipelines_app/features/runs/domain/run_models.dart';
import 'package:pipelines_app/features/runs/ui/run_more_menu.dart';
import 'package:pipelines_app/features/runs/ui/runs_list.dart';
final _finished = {
@@ -14,6 +16,14 @@ final _finished = {
'completed_steps': 3,
};
class _FakeGateway implements ApiGateway {
@override
Future<JsonMap> call(String type, [JsonMap fields = const {}]) async => {};
@override
Stream<JsonMap> get frames => const Stream.empty();
}
void main() {
test('row facts: when, how long and how far', () {
final facts = runRowFacts(_finished, DateTime.utc(2026, 10, 22));
@@ -59,4 +69,39 @@ void main() {
expect(right.right, greaterThan(800 - 32));
}
});
testWidgets('uses a muted pipeline fallback only when it is absent', (
tester,
) async {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: RunListRow(
run: {..._finished, 'name': ''},
now: DateTime.utc(2026, 10, 22),
),
),
),
);
expect(find.text('Pipeline unavailable'), findsOneWidget);
});
testWidgets('gives a list action menu a per-run key', (tester) async {
await tester.pumpWidget(
MaterialApp(
home: Scaffold(
body: RunListRow(
run: _finished,
now: DateTime.utc(2026, 10, 22),
gateway: _FakeGateway(),
onRunChanged: (_) {},
),
),
),
);
expect(find.byKey(const ValueKey('run-list-more-menu-42')), findsOneWidget);
expect(find.byKey(runMoreMenuKey), findsNothing);
});
}