fix(home): 稳定二级标签切换布局
This commit is contained in:
1 parent
4304727ffd
commit
b3ea85df41
4 files changed
+33
-37
No files matched your search
@@ -167,14 +167,14 @@ void main() {
|
||||
),
|
||||
);
|
||||
expect(secondaryTag.style?.fontSize, AppDimens.homeSecondaryTagFont);
|
||||
expect(secondaryTag.style?.fontWeight, FontWeight.w400);
|
||||
expect(secondaryTag.style?.fontWeight, FontWeight.w600);
|
||||
expect(secondaryTag.style?.color, AppColors.textTertiary);
|
||||
final unselectedTagChip = tester.widget<AnimatedContainer>(
|
||||
find.byKey(const Key('home-tag-animated-hot')),
|
||||
);
|
||||
expect(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('home-tag-hot')),
|
||||
matching: find.byType(Container),
|
||||
),
|
||||
findsNothing,
|
||||
(unselectedTagChip.decoration! as BoxDecoration).color,
|
||||
AppColors.transparent,
|
||||
);
|
||||
final primaryStart = tester.getTopLeft(find.text('Featured'));
|
||||
final pageStart = tester.getTopLeft(searchBox);
|
||||
@@ -183,23 +183,20 @@ void main() {
|
||||
tester.getTopLeft(find.text('New')).dx -
|
||||
tester.getBottomRight(find.text('Featured')).dx;
|
||||
expect(primaryGap, closeTo(AppDimens.homePrimaryCategoryGap, 0.1));
|
||||
final tagStart = tester.getTopLeft(find.text('Hot'));
|
||||
final tagStart = tester.getTopLeft(find.byKey(const Key('home-tag-hot')));
|
||||
expect(tagStart.dx, pageStart.dx);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('home-tag-hot'))).height,
|
||||
AppDimens.homeSecondaryTagHeight,
|
||||
);
|
||||
final tagGap =
|
||||
tester.getTopLeft(find.text('Uplifting')).dx -
|
||||
tester.getBottomRight(find.text('Hot')).dx;
|
||||
tester.getTopLeft(find.byKey(const Key('home-tag-uplifting'))).dx -
|
||||
tester.getBottomRight(find.byKey(const Key('home-tag-hot'))).dx;
|
||||
expect(tagGap, closeTo(AppDimens.homeSecondaryTagGap, 0.1));
|
||||
await tester.tap(find.byKey(const Key('home-tag-hot')));
|
||||
await tester.pump();
|
||||
final selectedTagChip = tester.widget<Container>(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('home-tag-hot')),
|
||||
matching: find.byType(Container),
|
||||
),
|
||||
final selectedTagChip = tester.widget<AnimatedContainer>(
|
||||
find.byKey(const Key('home-tag-animated-hot')),
|
||||
);
|
||||
expect(
|
||||
(selectedTagChip.decoration! as BoxDecoration).color,
|
||||
|
||||
Reference in new issue
Block a user