fix(player): 移除详情暂停重复按钮
This commit is contained in:
1 parent
c82502559b
commit
f0c53542ef
2 files changed
+73
-1
No files matched your search
@@ -9,6 +9,7 @@ import 'package:fruitshorts/app.dart';
|
||||
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/player/player_view.dart';
|
||||
|
||||
import '../support/fake_catalog.dart';
|
||||
import '../support/fake_category.dart';
|
||||
@@ -67,6 +68,60 @@ void main() {
|
||||
);
|
||||
expect(tester.takeException(), isNull);
|
||||
});
|
||||
|
||||
testWidgets('should_keep_single_pause_toggle_when_detail_player_is_paused', (
|
||||
tester,
|
||||
) async {
|
||||
await _pumpApp(tester);
|
||||
await tester.binding.handlePopRoute();
|
||||
await tester.pumpAndSettle();
|
||||
await tester.binding.handlePopRoute();
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('drawer-open-series')));
|
||||
await tester.pumpAndSettle();
|
||||
await tester.tap(find.byKey(const Key('detail-cta')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
await tester.tap(find.byKey(const Key('player-play-toggle')));
|
||||
await tester.pumpAndSettle();
|
||||
|
||||
expect(find.byKey(const Key('player-play-toggle')), findsOneWidget);
|
||||
expect(find.byKey(const Key('home-feed-center-play')), findsNothing);
|
||||
expect(find.byIcon(Icons.play_arrow_rounded), findsOneWidget);
|
||||
});
|
||||
|
||||
test('should_only_show_feed_pause_indicator_in_home_mode', () {
|
||||
expect(
|
||||
shouldShowFeedPauseIndicator(
|
||||
homeMode: true,
|
||||
selected: true,
|
||||
ready: true,
|
||||
playing: false,
|
||||
pip: false,
|
||||
),
|
||||
isTrue,
|
||||
);
|
||||
expect(
|
||||
shouldShowFeedPauseIndicator(
|
||||
homeMode: false,
|
||||
selected: true,
|
||||
ready: true,
|
||||
playing: false,
|
||||
pip: false,
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
expect(
|
||||
shouldShowFeedPauseIndicator(
|
||||
homeMode: true,
|
||||
selected: true,
|
||||
ready: true,
|
||||
playing: true,
|
||||
pip: false,
|
||||
),
|
||||
isFalse,
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
void _expectFullscreenOverlay() {
|
||||
|
||||
Reference in new issue
Block a user