style(recommend): 重排全部短剧筛选与网格
This commit is contained in:
1 parent
14885d9efa
commit
4eb411ef28
5 files changed
+170
-65
No files matched your search
@@ -237,14 +237,49 @@ void main() {
|
||||
await tester.tap(find.byKey(const Key('recommend-tab-all')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('all-dramas-grid')), findsOneWidget);
|
||||
final grid = tester.widget<SliverGrid>(
|
||||
find.byKey(const Key('all-dramas-grid')),
|
||||
);
|
||||
final delegate =
|
||||
grid.gridDelegate as SliverGridDelegateWithFixedCrossAxisCount;
|
||||
expect(delegate.crossAxisCount, 3);
|
||||
expect(delegate.crossAxisSpacing, AppDimens.allDramasGridGap);
|
||||
expect(delegate.mainAxisSpacing, AppDimens.allDramasGridRowGap);
|
||||
for (var row = 0; row < 4; row++) {
|
||||
expect(find.byKey(Key('all-filter-row-$row')), findsOneWidget);
|
||||
}
|
||||
expect(find.byKey(const Key('all-filter-local')), findsOneWidget);
|
||||
expect(find.byKey(const Key('all-filter-subtitles')), findsOneWidget);
|
||||
for (final key in [
|
||||
'all-filter-reversal',
|
||||
'all-filter-uplifting',
|
||||
'all-filter-modern',
|
||||
'all-filter-sweet',
|
||||
'all-filter-angst',
|
||||
]) {
|
||||
expect(find.byKey(Key(key)), findsOneWidget);
|
||||
}
|
||||
await tester.tap(find.byKey(const Key('all-filter-local')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('all-dramas-empty')), findsOneWidget);
|
||||
expect(_textStyle(tester, 'Local').fontWeight, FontWeight.w600);
|
||||
expect(_textStyle(tester, 'Local').color, AppColors.textPrimary);
|
||||
final selectedChip = tester.widget<Container>(
|
||||
find
|
||||
.descendant(
|
||||
of: find.byKey(const Key('all-filter-local')),
|
||||
matching: find.byType(Container),
|
||||
)
|
||||
.first,
|
||||
);
|
||||
expect(
|
||||
(selectedChip.decoration! as BoxDecoration).color,
|
||||
AppColors.filterChipSelected,
|
||||
);
|
||||
expect(
|
||||
tester.getSize(find.byKey(const Key('all-filter-local'))).height,
|
||||
AppDimens.filterChipHeight,
|
||||
);
|
||||
await tester.tap(find.byKey(const Key('all-filter-all')).first);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('all-sort-new')));
|
||||
@@ -265,6 +300,18 @@ void main() {
|
||||
(chipContainer.decoration! as BoxDecoration).borderRadius,
|
||||
BorderRadius.circular(AppDimens.filterChipRadius),
|
||||
);
|
||||
final filterButton = find.byKey(const Key('all-dramas-filter-page'));
|
||||
expect(
|
||||
tester.getSize(filterButton),
|
||||
const Size.square(AppDimens.allDramasFilterIcon),
|
||||
);
|
||||
expect(
|
||||
tester.getRect(filterButton).right,
|
||||
closeTo(
|
||||
tester.getRect(find.byKey(const Key('all-filter-row-3'))).right,
|
||||
0.1,
|
||||
),
|
||||
);
|
||||
|
||||
await tester.tap(find.byKey(const Key('recommend-tab-playlist')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
Reference in new issue
Block a user