feat(app): Runs and Chat tabs badge running runs and unread chats; unread chat rows carry a New badge

This commit is contained in:
2026-10-23 20:15:01 +01:00
parent 11ab9beb7b
commit d373f4c48e
7 changed files with 247 additions and 5 deletions
+39
View File
@@ -60,4 +60,43 @@ void main() {
expect(find.byKey(const ValueKey('shell.search')), findsNothing);
});
}
testWidgets('tabs show the running and unread counts their screens publish', (
tester,
) async {
tester.view.physicalSize = const Size(390, 844);
tester.view.devicePixelRatio = 1;
addTearDown(tester.view.reset);
await tester.pumpWidget(
MaterialApp(
home: AdaptiveShell(
destination: AppDestination.runs,
destinationBodies: {
AppDestination.runs: (_) => const ShellBadge(
kind: ShellBadgeKind.running,
count: 2,
child: Text('runs'),
),
},
),
),
);
await tester.pump();
final running = find.byKey(const ValueKey('shell.badge.runs.running'));
expect(
find.descendant(of: running, matching: find.text('2')),
findsOneWidget,
);
expect(
find.byKey(const ValueKey('shell.badge.chat.unread')),
findsOneWidget,
);
expect(
find.descendant(
of: find.byKey(const ValueKey('shell.badge.chat.unread')),
matching: find.byType(Text),
),
findsNothing,
);
});
}