fix(home): 调整首页分类与卡片标签样式

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:22:05 +08:00
1 parent 7446431511
commit 4f6116896f
14 files changed
+251 -117

No files matched your search

+26 -6
View File
@@ -68,6 +68,16 @@ void main() {
find.byKey(const Key('following-cover-the-signal-demo')),
);
expect(cover.aspectRatio, AppDimens.cardCoverAspectRatio);
final coverClip = tester.widget<ClipRRect>(
find.descendant(
of: find.byKey(const Key('following-cover-the-signal-demo')),
matching: find.byType(ClipRRect),
),
);
expect(
coverClip.borderRadius,
BorderRadius.circular(AppDimens.cardCoverRadius),
);
final title = tester.widget<Text>(
find.descendant(of: card, matching: find.text('The Signal')),
);
@@ -79,14 +89,24 @@ void main() {
);
expect(views.style?.fontSize, AppDimens.cardViewsFont);
expect(views.style?.color, AppColors.textPrimary);
final tags = tester.widget<Text>(
find.byKey(const Key('following-tags-the-signal-demo')),
expect(
find.descendant(
of: find.byKey(const Key('following-views-the-signal-demo')),
matching: find.byIcon(Icons.auto_awesome_rounded),
),
findsOneWidget,
);
expect(tags.data, 'Suspense | Mystery');
expect(tags.style?.fontSize, AppDimens.cardTagFont);
expect(tags.style?.color, AppColors.textTertiary);
final ribbon = find.byKey(
const Key('drama-genre-ribbon-the-signal-demo-0'),
);
expect(ribbon, findsOneWidget);
final ribbonText = tester.widget<Text>(
find.descendant(of: ribbon, matching: find.byType(Text)),
);
expect(ribbonText.data, 'Suspense');
expect(ribbonText.style?.fontSize, AppDimens.cardBadgeFont);
expect(ribbonText.style?.color, AppColors.textPrimary);
expect(tester.getTopLeft(title).dx, tester.getTopLeft(cover).dx);
expect(tester.getTopLeft(tags).dx, tester.getTopLeft(cover).dx);
await tester.tap(find.byKey(const Key('following-edit')));
await tester.pumpAndSettle();