feat(app): 客户端展示多语言并支持筛选分页
This commit is contained in:
1 parent
8481611372
commit
8b50b5bd06
68 files changed
+2742
-1120
No files matched your search
@@ -45,24 +45,24 @@ void main() {
|
||||
await _pumpApp(tester, repository);
|
||||
|
||||
final sectionKeys = [
|
||||
const Key('home-section-featured'),
|
||||
const Key('home-section-new'),
|
||||
const Key('home-section-categories'),
|
||||
const Key('home-section-ranking'),
|
||||
const Key('home-section-category-古装'),
|
||||
const Key('home-section-category-社群'),
|
||||
const Key('home-section-category-爽剧'),
|
||||
const Key('home-section-category-甜宠'),
|
||||
const Key('home-section-category-打脸虐渣'),
|
||||
const Key('home-section-category-虐恋'),
|
||||
];
|
||||
final sectionCenters = sectionKeys
|
||||
.map((key) => tester.getCenter(find.byKey(key)).dx)
|
||||
.toList();
|
||||
expect(sectionCenters, orderedEquals(sectionCenters.toList()..sort()));
|
||||
expect(find.byKey(const Key('home-secondary-tags')), findsNothing);
|
||||
expect(find.text('Featured'), findsOneWidget);
|
||||
expect(find.text('New'), findsOneWidget);
|
||||
expect(find.text('Categories'), findsOneWidget);
|
||||
expect(find.text('Charts'), findsOneWidget);
|
||||
expect(find.text('Costume'), findsOneWidget);
|
||||
expect(find.text('Community'), findsOneWidget);
|
||||
expect(find.text('Featured'), findsNothing);
|
||||
expect(find.text('New'), findsNothing);
|
||||
expect(find.text('Categories'), findsNothing);
|
||||
expect(find.text('Charts'), findsNothing);
|
||||
expect(find.text('古装'), findsOneWidget);
|
||||
expect(find.text('社群'), findsOneWidget);
|
||||
expect(find.byKey(const Key('mine-mini-player')), findsNothing);
|
||||
expect(find.byType(FloatingActionButton), findsNothing);
|
||||
});
|
||||
@@ -94,31 +94,9 @@ void main() {
|
||||
}
|
||||
|
||||
expect(find.byKey(const Key('home-grid')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-section-featured')), findsNothing);
|
||||
expect(firstDramaId(), 'page1-0');
|
||||
|
||||
await tester.tap(find.byKey(const Key('home-section-new')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('new-releases-page')), findsNothing);
|
||||
expect(find.byKey(const Key('home-secondary-tags')), findsNothing);
|
||||
expect(firstDramaId(), 'page1-9');
|
||||
|
||||
await tester.tap(find.byKey(const Key('home-section-ranking')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('ranking-page')), findsOneWidget);
|
||||
expect(find.byKey(const Key('ranking-hero')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-grid-cards')), findsNothing);
|
||||
final home = tester.widget<DecoratedBox>(find.byKey(const Key('home-grid')));
|
||||
expect(
|
||||
(home.decoration as BoxDecoration).gradient,
|
||||
AppTheme.pageGradient,
|
||||
);
|
||||
|
||||
await tester.tap(find.byKey(const Key('home-section-categories')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('filter-page')), findsNothing);
|
||||
expect(find.byKey(const Key('home-secondary-tags')), findsNothing);
|
||||
expect(find.byKey(const Key('home-grid-cards')), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('home-section-category-古装')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(firstDramaId(), 'page1-0');
|
||||
@@ -149,9 +127,9 @@ void main() {
|
||||
final before = tester.state<ScrollableState>(scrollable).position.pixels;
|
||||
expect(before, greaterThan(0));
|
||||
|
||||
await tester.tap(find.byKey(const Key('home-section-new')));
|
||||
await tester.tap(find.byKey(const Key('home-section-category-社群')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('home-section-featured')));
|
||||
await tester.tap(find.byKey(const Key('home-section-category-古装')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('home-secondary-tags')), findsNothing);
|
||||
|
||||
@@ -180,7 +158,7 @@ void main() {
|
||||
|
||||
expect(find.byKey(const Key('home-secondary-tags')), findsNothing);
|
||||
final selected = tester.widget<AnimatedDefaultTextStyle>(
|
||||
find.byKey(const Key('home-primary-label-newReleases')),
|
||||
find.byKey(const Key('home-primary-label-community')),
|
||||
);
|
||||
expect(selected.style.fontSize, AppDimens.homePrimaryTabSelectedFont);
|
||||
expect(selected.style.fontWeight, FontWeight.w700);
|
||||
|
||||
Reference in new issue
Block a user