fix(home): 调整首页分类与卡片标签样式
This commit is contained in:
1 parent
7446431511
commit
4f6116896f
14 files changed
+251
-117
No files matched your search
@@ -85,6 +85,13 @@ void main() {
|
||||
expect(moreText.style?.fontSize, AppDimens.recommendSectionMore);
|
||||
expect(moreText.style?.color, AppColors.textSecondary);
|
||||
final card = find.byKey(const Key('recommend-card-hits-the-signal-demo'));
|
||||
final coverClip = tester.widget<ClipRRect>(
|
||||
find.descendant(of: card, matching: find.byType(ClipRRect)),
|
||||
);
|
||||
expect(
|
||||
coverClip.borderRadius,
|
||||
BorderRadius.circular(AppDimens.cardCoverRadius),
|
||||
);
|
||||
final cover = tester.widget<AspectRatio>(
|
||||
find.descendant(of: card, matching: find.byType(AspectRatio)),
|
||||
);
|
||||
@@ -103,14 +110,22 @@ void main() {
|
||||
);
|
||||
expect(views.style?.fontSize, AppDimens.cardViewsFont);
|
||||
expect(views.style?.color, AppColors.textPrimary);
|
||||
final tags = tester.widget<Text>(
|
||||
find.byKey(const Key('recommend-tags-hits-the-signal-demo')),
|
||||
final viewIcon = find.descendant(
|
||||
of: find.byKey(const Key('recommend-views-hits-the-signal-demo')),
|
||||
matching: find.byIcon(Icons.auto_awesome_rounded),
|
||||
);
|
||||
expect(tags.data, 'Suspense | Mystery');
|
||||
expect(tags.style?.fontSize, AppDimens.cardTagFont);
|
||||
expect(tags.style?.color, AppColors.textTertiary);
|
||||
expect(viewIcon, findsOneWidget);
|
||||
final ribbon = find.byKey(
|
||||
const Key('drama-genre-ribbon-hits-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(cardTitle).dx, tester.getTopLeft(cover).dx);
|
||||
expect(tester.getTopLeft(tags).dx, tester.getTopLeft(cover).dx);
|
||||
});
|
||||
|
||||
testWidgets('should_switch_inner_tabs_without_losing_grid_filter_state', (
|
||||
|
||||
Reference in new issue
Block a user