Remove the Runs error counter for now
Keep the running indicator and Needs you flow, but remove the failed-count badge and its tab count plumbing until unseen-state behavior is addressed. Preserve the unfinished seen-state work separately. Verify application, Runs, attention and shell regressions.
This commit is contained in:
@@ -3,12 +3,10 @@ import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:pipelines_app/shell/adaptive_shell.dart';
|
||||
import 'package:pipelines_app/ui/adaptive/floating_destination_bar.dart';
|
||||
|
||||
/// The Runs tab mirrors the attention count in every mount: the floating tab
|
||||
/// bar at full width on a phone and right-aligned on a wide window. Zero draws
|
||||
/// the bare icon with no count and no attention semantics.
|
||||
/// The Runs tab keeps running work visible without an error counter.
|
||||
void main() {
|
||||
final needingAttention = RegExp('3 failed runs');
|
||||
final anyAttention = RegExp('failed runs');
|
||||
final needingAttention = RegExp('3 runs in progress');
|
||||
final anyAttention = RegExp('runs in progress');
|
||||
|
||||
Future<void> pumpShell(
|
||||
WidgetTester tester, {
|
||||
@@ -19,7 +17,7 @@ void main() {
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.resetPhysicalSize);
|
||||
addTearDown(tester.view.resetDevicePixelRatio);
|
||||
final shell = AdaptiveShell(failedRunCount: count);
|
||||
final shell = AdaptiveShell(runningRunCount: count, attentionCount: 99);
|
||||
await tester.pumpWidget(MaterialApp(home: shell));
|
||||
}
|
||||
|
||||
@@ -31,9 +29,12 @@ void main() {
|
||||
await pumpShell(tester, width: width, count: 3);
|
||||
expect(find.byType(FloatingDestinationBar), findsOneWidget);
|
||||
expect(find.byType(NavigationRail), findsNothing);
|
||||
final badge = find.byType(Badge);
|
||||
final badge = find.byKey(const ValueKey('shell.badge.runs.running'));
|
||||
expect(badge, findsOneWidget);
|
||||
expect(tester.widget<Badge>(badge).isLabelVisible, isTrue);
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.badge.runs.failed')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(
|
||||
find.descendant(of: badge, matching: find.text('3')),
|
||||
findsOneWidget,
|
||||
@@ -45,9 +46,12 @@ void main() {
|
||||
testWidgets('$mount hides the badge at zero', (tester) async {
|
||||
final semantics = tester.ensureSemantics();
|
||||
await pumpShell(tester, width: width, count: 0);
|
||||
final badge = find.byType(Badge);
|
||||
final badge = find.byKey(const ValueKey('shell.badge.runs.running'));
|
||||
expect(badge, findsOneWidget);
|
||||
expect(tester.widget<Badge>(badge).isLabelVisible, isFalse);
|
||||
expect(
|
||||
find.byKey(const ValueKey('shell.badge.runs.failed')),
|
||||
findsNothing,
|
||||
);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: badge,
|
||||
@@ -66,7 +70,10 @@ void main() {
|
||||
await tester.tap(find.byKey(ValueKey('shell.destination.$name')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(
|
||||
find.descendant(of: find.byType(Badge), matching: find.text('2')),
|
||||
find.descendant(
|
||||
of: find.byKey(const ValueKey('shell.badge.runs.running')),
|
||||
matching: find.text('2'),
|
||||
),
|
||||
findsOneWidget,
|
||||
reason: 'badge missing on $name',
|
||||
);
|
||||
|
||||
@@ -66,10 +66,9 @@ void main() {
|
||||
),
|
||||
);
|
||||
|
||||
Widget shell({int attention = 0, int failed = 0}) {
|
||||
Widget shell({int attention = 0}) {
|
||||
final app = AdaptiveShell(
|
||||
attentionCount: attention,
|
||||
failedRunCount: failed,
|
||||
destinationBodies: {
|
||||
AppDestination.runs: (_) => ShellBadge(
|
||||
kind: ShellBadgeKind.running,
|
||||
@@ -219,14 +218,14 @@ void main() {
|
||||
);
|
||||
});
|
||||
|
||||
testWidgets('the Runs tab shows running and failed indicators together', (
|
||||
testWidgets('the Runs tab keeps running work without an error counter', (
|
||||
tester,
|
||||
) async {
|
||||
await setSize(tester, const Size(1200, 800));
|
||||
await tester.pumpWidget(shell(attention: 2, failed: 2));
|
||||
await tester.pumpWidget(shell(attention: 2));
|
||||
await tester.pump();
|
||||
await tester.pump();
|
||||
expect(find.text('2'), findsOneWidget);
|
||||
expect(find.text('2'), findsNothing);
|
||||
expect(find.text('4'), findsOneWidget);
|
||||
|
||||
await tester.pumpWidget(shell());
|
||||
|
||||
@@ -5,46 +5,38 @@ import 'package:pipelines_app/shell/adaptive_shell.dart';
|
||||
void main() {
|
||||
for (final width in [390.0, 1000.0]) {
|
||||
for (final brightness in Brightness.values) {
|
||||
testWidgets('running and failed are distinct at $width $brightness', (
|
||||
tester,
|
||||
) async {
|
||||
tester.view.physicalSize = Size(width, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
final semantics = tester.ensureSemantics();
|
||||
final theme = ThemeData(brightness: brightness);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: theme,
|
||||
home: const AdaptiveShell(runningRunCount: 2, failedRunCount: 3),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
final failed = find.byKey(const ValueKey('shell.badge.runs.failed'));
|
||||
final running = find.byKey(const ValueKey('shell.badge.runs.running'));
|
||||
expect(
|
||||
find.descendant(of: failed, matching: find.text('3')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.descendant(of: running, matching: find.text('2')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
tester.widget<Badge>(failed).backgroundColor,
|
||||
theme.colorScheme.error,
|
||||
);
|
||||
expect(
|
||||
tester.getRect(find.text('3')).bottom,
|
||||
lessThan(tester.getRect(find.text('2')).top),
|
||||
);
|
||||
expect(
|
||||
find.bySemanticsLabel(RegExp('2 runs in progress, 3 failed runs')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
semantics.dispose();
|
||||
});
|
||||
testWidgets(
|
||||
'running stays visible without an error counter at $width $brightness',
|
||||
(tester) async {
|
||||
tester.view.physicalSize = Size(width, 900);
|
||||
tester.view.devicePixelRatio = 1;
|
||||
addTearDown(tester.view.reset);
|
||||
final semantics = tester.ensureSemantics();
|
||||
final theme = ThemeData(brightness: brightness);
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
theme: theme,
|
||||
home: const AdaptiveShell(runningRunCount: 2, attentionCount: 3),
|
||||
),
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
final failed = find.byKey(const ValueKey('shell.badge.runs.failed'));
|
||||
final running = find.byKey(
|
||||
const ValueKey('shell.badge.runs.running'),
|
||||
);
|
||||
expect(failed, findsNothing);
|
||||
expect(
|
||||
find.descendant(of: running, matching: find.text('2')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(
|
||||
find.bySemanticsLabel(RegExp('2 runs in progress')),
|
||||
findsOneWidget,
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
semantics.dispose();
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user