fix(home): 调整封面播放量位置

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:30:33 +08:00
1 parent e11f55777e
commit 972e542e5c
10 files changed
+179 -147

No files matched your search

+11 -3
View File
@@ -64,9 +64,10 @@ void main() {
expect(delegate.mainAxisSpacing, AppDimens.homeGridRowGap);
expect(delegate.childAspectRatio, AppDimens.followingGridAspectRatio);
final card = find.byKey(const Key('following-card-the-signal-demo'));
final cover = tester.widget<AspectRatio>(
find.byKey(const Key('following-cover-the-signal-demo')),
final coverFinder = find.byKey(
const Key('following-cover-the-signal-demo'),
);
final cover = tester.widget<AspectRatio>(coverFinder);
expect(cover.aspectRatio, AppDimens.cardCoverAspectRatio);
final coverClip = tester.widget<ClipRRect>(
find.descendant(
@@ -89,6 +90,13 @@ void main() {
);
expect(views.style?.fontSize, AppDimens.cardPlayCountFont);
expect(views.style?.fontWeight, FontWeight.w400);
expect(
find.descendant(
of: coverFinder,
matching: find.byKey(const Key('following-views-the-signal-demo')),
),
findsOneWidget,
);
expect(views.style?.color, AppColors.textPrimary);
expect(
find.descendant(
@@ -103,7 +111,7 @@ void main() {
expect(tags.data, 'Suspense | Mystery');
expect(tags.style?.fontSize, AppDimens.cardTagFont);
expect(tags.style?.color, AppColors.textTertiary);
expect(tester.getTopLeft(title).dx, tester.getTopLeft(cover).dx);
expect(tester.getTopLeft(title).dx, tester.getTopLeft(coverFinder).dx);
expect(tester.getTopLeft(tags).dx, tester.getTopLeft(cover).dx);
await tester.tap(find.byKey(const Key('following-edit')));
+12
View File
@@ -79,6 +79,18 @@ void main() {
expect(viewsText.style?.color, AppColors.navSelected);
expect(
find.descendant(of: cover, matching: find.byKey(views)),
findsOneWidget,
);
expect(
tester.getTopRight(views).dx,
closeTo(tester.getTopRight(cover).dx, 1),
);
expect(
tester.getBottomLeft(cover).dy - tester.getBottomLeft(views).dy,
AppDimens.cardPlayCountBottom,
);
expect(
find.descendant(of: views, matching: find.byType(Container)),
findsNothing,
);
expect(
+12 -3
View File
@@ -92,9 +92,11 @@ void main() {
coverClip.borderRadius,
BorderRadius.circular(AppDimens.cardCoverRadius),
);
final cover = tester.widget<AspectRatio>(
find.descendant(of: card, matching: find.byType(AspectRatio)),
final coverFinder = find.descendant(
of: card,
matching: find.byType(AspectRatio),
);
final cover = tester.widget<AspectRatio>(coverFinder);
expect(cover.aspectRatio, AppDimens.cardCoverAspectRatio);
final cardTitle = tester.widget<Text>(
find.byKey(const Key('recommend-title-hits-the-signal-demo')),
@@ -110,6 +112,13 @@ void main() {
);
expect(views.style?.fontSize, AppDimens.cardPlayCountFont);
expect(views.style?.fontWeight, FontWeight.w400);
expect(
find.descendant(
of: coverFinder,
matching: find.byKey(const Key('recommend-views-hits-the-signal-demo')),
),
findsOneWidget,
);
expect(views.style?.color, AppColors.textPrimary);
final viewIcon = find.descendant(
of: find.byKey(const Key('recommend-views-hits-the-signal-demo')),
@@ -132,7 +141,7 @@ void main() {
expect(tags.data, 'Suspense | Mystery');
expect(tags.style?.fontSize, AppDimens.cardTagFont);
expect(tags.style?.color, AppColors.textTertiary);
expect(tester.getTopLeft(cardTitle).dx, tester.getTopLeft(cover).dx);
expect(tester.getTopLeft(cardTitle).dx, tester.getTopLeft(coverFinder).dx);
expect(tester.getTopLeft(tags).dx, tester.getTopLeft(cover).dx);
});