fix(recommend): 更正筛选按钮所属页面

This commit is contained in:
Zhou Weidong committed 2026-10-22 21:05:51 +08:00
1 parent bf20e44b85
commit 13d70fcef2
10 files changed
+124 -107

No files matched your search

+28 -6
View File
@@ -94,21 +94,43 @@ void main() {
expect(find.byKey(const Key('home-section-category-古装')), findsOneWidget);
expect(find.byKey(const Key('home-section-category-社群')), findsOneWidget);
expect(find.byKey(const Key('home-secondary-tags')), findsOneWidget);
expect(find.byKey(const Key('home-grid-filter')), findsOneWidget);
expect(
tester.getRect(find.byKey(const Key('home-secondary-tags'))).left,
closeTo(AppDimens.feedPageHorizontal, 0.1),
tester.getSize(find.byKey(const Key('home-grid-filter'))),
const Size.square(AppDimens.homeSecondaryFilterVisualSize),
);
expect(
tester.getRect(find.byKey(const Key('home-secondary-tags'))).right,
tester.getSize(find.byKey(const Key('home-secondary-filter-visual'))),
const Size.square(AppDimens.homeSecondaryFilterVisualSize),
);
expect(
tester.getCenter(find.byKey(const Key('home-grid-filter'))).dy,
closeTo(tester.getCenter(find.byKey(const Key('home-tag-hot'))).dy, 0.1),
);
expect(
tester.getRect(find.byKey(const Key('home-grid-filter'))).right,
closeTo(
tester.getRect(find.byKey(const Key('home-grid'))).right -
AppDimens.feedPageHorizontal,
0.1,
),
);
expect(find.byKey(const Key('home-grid-filter')), findsNothing);
expect(find.byKey(const Key('home-secondary-filter-visual')), findsNothing);
expect(find.byKey(const Key('home-secondary-filter-icon')), findsNothing);
final filterIcon = tester.widget<CustomPaint>(
find.byKey(const Key('home-secondary-filter-icon')),
);
expect(
filterIcon.size,
const Size.square(AppDimens.homeSecondaryFilterIcon),
);
final filterMaterial = tester.widget<Material>(
find
.ancestor(
of: find.byKey(const Key('home-grid-filter')),
matching: find.byType(Material),
)
.first,
);
expect(filterMaterial.color, AppColors.transparent);
final searchBox = find.descendant(
of: find.byKey(const Key('home-search-entry')),
matching: find.byType(Container),
@@ -25,7 +25,6 @@ void main() {
body: AllDramasFilterGrid(
feedController: controller,
onOpenDrama: (_) {},
onOpenFilter: () {},
),
),
),
+2 -33
View File
@@ -309,7 +309,7 @@ void main() {
}
expect(
tester.getSize(find.byKey(const Key('all-filter-row-3'))).height,
AppDimens.allDramasFilterButton,
AppDimens.filterChipHeight,
);
expect(
tester.getRect(find.byKey(const Key('all-dramas-scroll'))).top -
@@ -437,38 +437,7 @@ void main() {
(chipContainer.decoration! as BoxDecoration).borderRadius,
BorderRadius.circular(AppDimens.filterChipRadius),
);
final filterButton = find.byKey(const Key('all-dramas-filter-page'));
expect(
find.descendant(
of: find.byKey(const Key('all-filter-scroll-3')),
matching: filterButton,
),
findsNothing,
);
expect(
tester.getSize(filterButton),
const Size.square(AppDimens.allDramasFilterButton),
);
expect(
tester.getRect(filterButton).right,
closeTo(
tester.getRect(find.byKey(const Key('all-filter-row-3'))).right,
0.1,
),
);
final filterMaterial = tester.widget<Material>(
find.byKey(const Key('all-dramas-filter-page-button')),
);
expect(filterMaterial.color, AppColors.filterMenuButton);
expect(filterMaterial.shape, const CircleBorder());
final filterIcon = tester.widget<Icon>(
find.descendant(
of: filterButton,
matching: find.byIcon(Icons.filter_list_rounded),
),
);
expect(filterIcon.size, AppDimens.allDramasFilterIcon);
expect(filterIcon.color, AppColors.filterMenuIcon);
expect(find.byKey(const Key('all-dramas-filter-page')), findsNothing);
await tester.tap(find.byKey(const Key('recommend-tab-playlist')));
await tester.pumpAndSettle();