fix(home): 修复样式常量与测试类型错误

This commit is contained in:
Zhou Weidong committed 2026-10-22 18:43:02 +08:00
1 parent b3ea85df41
commit ba0ce2f8c0
5 files changed
+30 -24

No files matched your search

+9 -6
View File
@@ -79,9 +79,11 @@ void main() {
coverClip.borderRadius,
BorderRadius.circular(AppDimens.cardCoverRadius),
);
final title = tester.widget<Text>(
find.descendant(of: card, matching: find.text('The Signal')),
final titleFinder = find.descendant(
of: card,
matching: find.text('The Signal'),
);
final title = tester.widget<Text>(titleFinder);
expect(title.style?.fontSize, AppDimens.cardTitleFont);
expect(title.style?.fontWeight, FontWeight.w500);
expect(title.style?.height, AppDimens.cardTitleLineHeight);
@@ -105,14 +107,15 @@ void main() {
),
findsOneWidget,
);
final tags = tester.widget<Text>(
find.byKey(const Key('following-tags-the-signal-demo')),
final tagsFinder = find.byKey(
const Key('following-tags-the-signal-demo'),
);
final tags = tester.widget<Text>(tagsFinder);
expect(tags.data, 'Suspense | Mystery');
expect(tags.style?.fontSize, AppDimens.cardTagFont);
expect(tags.style?.color, AppColors.textTertiary);
expect(tester.getTopLeft(title).dx, tester.getTopLeft(coverFinder).dx);
expect(tester.getTopLeft(tags).dx, tester.getTopLeft(cover).dx);
expect(tester.getTopLeft(titleFinder).dx, tester.getTopLeft(coverFinder).dx);
expect(tester.getTopLeft(tagsFinder).dx, tester.getTopLeft(coverFinder).dx);
await tester.tap(find.byKey(const Key('following-edit')));
await tester.pumpAndSettle();