feat(app): Runs and Chat tabs badge running runs and unread chats; unread chat rows carry a New badge
This commit is contained in:
@@ -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,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user