fix(recommend): 修正标题与观看全集跳转

This commit is contained in:
Zhou Weidong committed 2026-10-22 20:31:41 +08:00
1 parent 23799353b5
commit 357492acb2
6 files changed
+82 -52

No files matched your search

+9 -6
View File
@@ -282,7 +282,7 @@ void main() {
await tester.pumpAndSettle();
expect(
tester.widget<PlayerPage>(find.byType(PlayerPage).last).homeMode,
isTrue,
isFalse,
);
});
@@ -321,7 +321,7 @@ void main() {
episode: const Episode(
id: 'feed-episode',
number: 2,
title: 'Ignored Episode Title',
title: 'Episode 2',
isFree: true,
),
controller: null,
@@ -353,10 +353,11 @@ void main() {
expect(
tester.widget<Text>(find.byKey(const Key('home-feed-title'))).data,
'Ignored Episode Title',
'Feed Drama',
);
final seriesTitle = tester.widget<Text>(
find.byKey(const Key('home-feed-series-title')),
);
expect(find.text('Feed Drama'), findsOneWidget);
final seriesTitle = tester.widget<Text>(find.text('Feed Drama'));
expect(seriesTitle.style?.fontSize, 19);
expect(seriesTitle.style?.fontWeight, FontWeight.w600);
expect(seriesTitle.style?.color, AppColors.textPrimary);
@@ -370,7 +371,9 @@ void main() {
expect(seriesChevron.color, AppColors.textPrimary);
expect(
tester.getTopLeft(find.byIcon(Icons.chevron_right_rounded)).dx -
tester.getTopRight(find.text('Feed Drama')).dx,
tester
.getTopRight(find.byKey(const Key('home-feed-series-title')))
.dx,
4,
);
expect(find.byKey(const Key('home-feed-info-card')), findsNothing);
+25 -1
View File
@@ -278,6 +278,30 @@ void main() {
expect(find.byKey(const Key('all-dramas-grid')), findsOneWidget);
});
testWidgets('should_open_standalone_player_from_title_and_watch_all', (
tester,
) async {
await _pumpRecommend(tester);
await tester.tap(find.byKey(const Key('home-feed-title-open')));
await tester.pumpAndSettle();
expect(
tester.widget<PlayerPage>(find.byType(PlayerPage).last).homeMode,
isFalse,
);
await tester.binding.handlePopRoute();
await tester.pumpAndSettle();
expect(find.byKey(const Key('recommend-page')), findsOneWidget);
expect(find.byKey(const Key('recommend-tab-recommend')), findsOneWidget);
await tester.tap(find.byKey(const Key('home-feed-full-series')));
await tester.pumpAndSettle();
expect(
tester.widget<PlayerPage>(find.byType(PlayerPage).last).homeMode,
isFalse,
);
});
testWidgets('should_open_player_and_search_from_recommend_page', (
tester,
) async {
@@ -290,7 +314,7 @@ void main() {
);
await tester.pumpAndSettle();
final player = tester.widget<PlayerPage>(find.byType(PlayerPage).last);
expect(player.homeMode, isTrue);
expect(player.homeMode, isFalse);
await tester.binding.handlePopRoute();
await tester.pumpAndSettle();