feat(home): 首页改为三列探索网格
This commit is contained in:
1 parent
6dea9d479e
commit
dd96792e33
29 files changed
+1912
-256
No files matched your search
@@ -35,13 +35,13 @@ void main() {
|
||||
InMemorySharedPreferencesAsync.empty();
|
||||
});
|
||||
|
||||
testWidgets('should_open_fullscreen_overlay_from_discover_card', (
|
||||
testWidgets('should_open_fullscreen_overlay_from_recommend_feed', (
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester);
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('home-drama-card-city-lights-demo')));
|
||||
await tester.tap(find.byKey(const Key('home-feed-full-series')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
_expectFullscreenOverlay(tester);
|
||||
@@ -59,6 +59,8 @@ void main() {
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester);
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
_expectPlayerNavigationBar(tester);
|
||||
|
||||
await _openSeriesPlayer(tester);
|
||||
@@ -78,6 +80,8 @@ void main() {
|
||||
);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pump();
|
||||
|
||||
final ticketLoading = find.byKey(const Key('player-ticket-loading'));
|
||||
expect(ticketLoading, findsOneWidget);
|
||||
@@ -160,6 +164,8 @@ void main() {
|
||||
return player;
|
||||
},
|
||||
);
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
final player = players.firstWhere((item) => item.playing);
|
||||
expect(player.playing, isTrue);
|
||||
|
||||
@@ -215,6 +221,8 @@ void main() {
|
||||
});
|
||||
await _pumpApp(tester);
|
||||
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('rail-comments')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
@@ -269,6 +277,8 @@ void main() {
|
||||
});
|
||||
final catalog = FakeCatalogRepository(dramas: [_countingDrama]);
|
||||
await _pumpApp(tester, catalog: catalog);
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(
|
||||
tester.widget<Text>(find.byKey(const Key('rail-save-count'))).data,
|
||||
@@ -865,7 +875,7 @@ void main() {
|
||||
);
|
||||
await _openSeriesPlayer(
|
||||
tester,
|
||||
cardKey: const Key('home-drama-card-long-copy-demo'),
|
||||
cardKey: const Key('home-feed-card-long-copy-demo'),
|
||||
);
|
||||
|
||||
expect(tester.takeException(), isNull);
|
||||
@@ -1004,7 +1014,7 @@ void main() {
|
||||
);
|
||||
await _openSeriesPlayer(
|
||||
tester,
|
||||
cardKey: const Key('home-drama-card-locked-demo'),
|
||||
cardKey: const Key('home-feed-card-locked-demo'),
|
||||
);
|
||||
expect(find.byKey(const Key('progress-loading')), findsNothing);
|
||||
expect(find.byKey(const Key('progress-loading-highlight')), findsNothing);
|
||||
@@ -1329,9 +1339,9 @@ Future<void> _clearFromMore(WidgetTester tester) async {
|
||||
|
||||
Future<void> _openSeriesPlayer(
|
||||
WidgetTester tester, {
|
||||
Key cardKey = const Key('home-drama-card-city-lights-demo'),
|
||||
Key cardKey = const Key('home-feed-card-city-lights-demo'),
|
||||
}) async {
|
||||
await tester.tap(find.byKey(const Key('tab-recommend')));
|
||||
await tester.tap(find.byKey(const Key('tab-home')));
|
||||
await tester.pumpAndSettle();
|
||||
final card = find.byKey(cardKey);
|
||||
await tester.scrollUntilVisible(
|
||||
@@ -1339,7 +1349,7 @@ Future<void> _openSeriesPlayer(
|
||||
220,
|
||||
scrollable: find
|
||||
.descendant(
|
||||
of: find.byKey(const Key('discover-refresh')),
|
||||
of: find.byKey(const Key('home-grid-refresh')),
|
||||
matching: find.byType(Scrollable),
|
||||
)
|
||||
.first,
|
||||
|
||||
Reference in new issue
Block a user