Merge branch 'worktree-agent-a099cbf073f6e9e51' into integrate/shell-wide
# Conflicts: # app/lib/features/runs/ui/run_detail_tabs.dart
This commit is contained in:
@@ -13,8 +13,9 @@ Future<void> pumpSchedules(
|
||||
ValueChanged<SavedSchedule>? onOpen,
|
||||
double textScale = 1,
|
||||
bool settle = true,
|
||||
Size size = const Size(390, 844),
|
||||
}) async {
|
||||
tester.view.physicalSize = const Size(390, 844);
|
||||
tester.view.physicalSize = size;
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
|
||||
@@ -29,7 +29,9 @@ void main() {
|
||||
);
|
||||
|
||||
expect(find.text('2 schedules'), findsOneWidget);
|
||||
expect(find.textContaining('not pipeline definitions'), findsOneWidget);
|
||||
// The strip carries the count only; the helper line lives in the
|
||||
// empty state.
|
||||
expect(find.textContaining('not pipeline definitions'), findsNothing);
|
||||
// Two lines per row: the name with its next run, then the timer
|
||||
// and pinned pipeline version. The editor holds the rest.
|
||||
expect(find.text('Research batteries'), findsOneWidget);
|
||||
|
||||
@@ -0,0 +1,54 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/features/schedules/ui/list/schedule_list_toolbar.dart';
|
||||
import 'package:pipelines_app/features/schedules/ui/list/schedule_list_view.dart';
|
||||
import 'package:pipelines_app/ui/layout/app_list_row.dart';
|
||||
|
||||
import 'schedule_list_test_support.dart';
|
||||
import 'schedule_screen_harness.dart';
|
||||
|
||||
/// On a wide window the rows share the toolbar strip's width, and the strip
|
||||
/// is one row: the field, the filter and the count as a muted label.
|
||||
void main() {
|
||||
for (final cupertino in [false, true]) {
|
||||
final host = cupertino ? 'Cupertino' : 'Material';
|
||||
|
||||
testWidgets('$host 1200: rows end under the strip and the strip is one '
|
||||
'row', (tester) async {
|
||||
await pumpSchedules(
|
||||
tester,
|
||||
cupertino: cupertino,
|
||||
size: const Size(1200, 800),
|
||||
gateway: FakeSchedulesGateway(
|
||||
(type, fields) async => schedulesReply([
|
||||
scheduleRecord(nextDue: '2026-10-22T09:00:00'),
|
||||
pausedRecord(),
|
||||
]),
|
||||
),
|
||||
);
|
||||
final strip = tester.getRect(find.byKey(scheduleToolbarKey));
|
||||
final row = tester.getRect(find.byKey(appListRowSurfaceKey).first);
|
||||
expect(row.left, 0);
|
||||
expect(row.width, kScheduleListMaxWidth);
|
||||
// The row's trailing time ends inside the strip's trailing edge.
|
||||
// The trailing time is the row's rightmost text, whatever its wording.
|
||||
final time = find
|
||||
.descendant(
|
||||
of: find.byKey(appListRowSurfaceKey).first,
|
||||
matching: find.byType(Text),
|
||||
)
|
||||
.evaluate()
|
||||
.map((element) => tester.getRect(find.byWidget(element.widget)))
|
||||
.reduce((a, b) => a.right >= b.right ? a : b);
|
||||
expect(time.right, lessThanOrEqualTo(strip.right - 12 + 0.5));
|
||||
|
||||
// Field, filter and count on one line.
|
||||
final field = tester.getRect(find.byKey(scheduleSearchFieldKey));
|
||||
final filter = tester.getRect(find.byKey(scheduleFilterKey));
|
||||
final count = tester.getRect(find.text('2 schedules'));
|
||||
expect((field.center.dy - filter.center.dy).abs(), lessThan(4));
|
||||
expect((count.center.dy - filter.center.dy).abs(), lessThan(4));
|
||||
expect(find.textContaining('not pipeline definitions'), findsNothing);
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user