fix(flutter): 调整收藏页星标操作

This commit is contained in:
Zhou Weidong committed 2026-10-20 16:36:56 +08:00
1 parent f62324084e
commit 1d8582dfaa
9 files changed
+28 -49

No files matched your search

+8 -1
View File
@@ -54,7 +54,7 @@ void main() {
tester.widget<Text>(find.byKey(const Key('favorites-count'))).data,
'2 favorites',
);
expect(find.text('Long press a card to remove'), findsOneWidget);
expect(find.text('Long press a card to remove'), findsNothing);
expect(find.text('Drama signal'), findsOneWidget);
expect(find.text('Drama city'), findsOneWidget);
final title = tester.widget<Text>(
@@ -71,12 +71,19 @@ void main() {
tester.getSize(find.byKey(const Key('favorite-remove-signal'))),
const Size(28, 28),
);
expect(find.byIcon(Icons.star_rounded), findsNWidgets(2));
expect(find.byIcon(Icons.favorite_rounded), findsNothing);
final refresh = tester.widget<RefreshIndicator>(
find.byType(RefreshIndicator),
);
expect(refresh.color, AppColors.blue);
expect(refresh.backgroundColor, AppColors.card);
expect(refresh.strokeWidth, 2);
await tester.tap(find.byKey(const Key('favorite-remove-signal')));
await tester.pumpAndSettle();
expect(find.byKey(const Key('favorite-card-signal')), findsNothing);
});
testWidgets('should_keep_card_and_show_failure_when_remove_fails', (