fix: 修正我的 UID 行高度

This commit is contained in:
Zhou Weidong committed 2026-10-22 21:49:47 +08:00
1 parent ce3ecc4d21
commit 19acbb2278
4 files changed
+65 -34

No files matched your search

+22
View File
@@ -39,6 +39,28 @@ void main() {
expect(find.text('Visitor'), findsOneWidget);
expect(find.text('UID: --'), findsOneWidget);
expect(find.byKey(const Key('mine-uid-copy')), findsOneWidget);
final uidRowSize = tester.getSize(find.byKey(const Key('mine-uid')));
expect(uidRowSize.height, closeTo(AppDimens.mineUidRowHeight, 0.1));
final nicknameRect = tester.getRect(find.byKey(const Key('mine-nickname')));
final uidRect = tester.getRect(find.byKey(const Key('mine-uid')));
expect(uidRect.top - nicknameRect.bottom, lessThanOrEqualTo(6));
final nickname = tester.widget<Text>(
find.byKey(const Key('mine-nickname')),
);
expect(nickname.style?.fontSize, AppDimens.mineUserName);
expect(nickname.style?.fontWeight, FontWeight.w700);
expect(nickname.style?.height, AppDimens.mineUserNameLineHeight);
final uid = tester.widget<Text>(find.text('UID: --'));
expect(uid.style?.fontSize, AppDimens.mineUid);
expect(uid.style?.color, AppColors.textTertiary);
final copyIcon = tester.widget<Icon>(
find.descendant(
of: find.byKey(const Key('mine-uid-copy')),
matching: find.byType(Icon),
),
);
expect(copyIcon.size, AppDimens.mineCopyIcon);
expect(copyIcon.color, AppColors.textTertiary);
expect(find.byKey(const Key('mine-login')), findsOneWidget);
expect(find.byKey(const Key('mine-edit')), findsNothing);
expect(find.byKey(const Key('mine-vip')), findsOneWidget);