fix(flutter): 剧场与榜单卡片直接进播放页

This commit is contained in:
Zhou Weidong committed 2026-10-20 15:15:27 +08:00
1 parent 04a1a4ee82
commit 720fd26935
6 files changed
+72 -47

No files matched your search

+15 -2
View File
@@ -8,7 +8,6 @@ import 'package:fruitshorts/core/data/repositories/favorite_repository.dart';
import 'package:fruitshorts/core/data/repositories/playback_repository.dart';
import 'package:fruitshorts/core/data/repositories/watch_history_repository.dart';
import 'package:fruitshorts/pages/discover/widgets/drama_grid.dart';
import 'package:fruitshorts/pages/drama_detail/drama_detail_view.dart';
import 'package:shared_preferences_platform_interface/in_memory_shared_preferences_async.dart';
import 'package:shared_preferences_platform_interface/shared_preferences_async_platform_interface.dart';
@@ -38,7 +37,7 @@ void main() {
await tester.tap(find.byKey(const Key('ranking-top-1')));
await tester.pumpAndSettle();
expect(find.byType(DramaDetailPage), findsOneWidget);
expect(find.byKey(const Key('player-scaffold')), findsOneWidget);
});
testWidgets('should_open_new_releases_sorted_by_id', (tester) async {
@@ -115,6 +114,20 @@ void main() {
expect(find.byKey(const Key('ranking-top-3')), findsNothing);
});
testWidgets('should_open_player_from_new_releases_card', (tester) async {
await _pumpTheater(tester);
await tester.tap(find.byKey(const Key('theater-toolbar-new')));
await tester.pumpAndSettle();
final card = find.byKey(const Key('home-drama-card-the-signal-demo'));
await tester.ensureVisible(card);
await tester.pumpAndSettle();
await tester.tap(card);
await tester.pumpAndSettle();
expect(find.byKey(const Key('player-scaffold')), findsOneWidget);
});
testWidgets('should_go_back_to_theater_from_ranking_page', (tester) async {
await _pumpTheater(tester);
await tester.tap(find.byKey(const Key('theater-toolbar-ranking')));