fix(recommend): 稳定进度拖动与清屏状态
This commit is contained in:
1 parent
76c4f1d411
commit
30b55afdd4
9 files changed
+339
-96
No files matched your search
@@ -35,6 +35,7 @@ void main() {
|
||||
expect(find.byKey(const Key('recommend-tab-playlist')), findsOneWidget);
|
||||
expect(find.byKey(const Key('recommend-tab-all')), findsOneWidget);
|
||||
expect(find.byKey(const Key('recommend-feed-player')), findsOneWidget);
|
||||
expect(find.byKey(const Key('recommend-top-gradient')), findsOneWidget);
|
||||
final recommendText = tester.widget<Text>(
|
||||
find.descendant(
|
||||
of: find.byKey(const Key('recommend-tab-recommend')),
|
||||
@@ -93,6 +94,21 @@ void main() {
|
||||
expect(find.byType(PageView), findsOneWidget);
|
||||
expect(find.byKey(const Key('recommend-section-hits')), findsNothing);
|
||||
expect(find.byType(AppBottomNav), findsOneWidget);
|
||||
|
||||
final progress = find.byKey(const Key('home-feed-progress'));
|
||||
final progressCenterY = tester.getCenter(progress).dy;
|
||||
final scrub = await tester.startGesture(tester.getCenter(progress));
|
||||
await scrub.moveBy(const Offset(40, 0));
|
||||
await tester.pump(const Duration(milliseconds: 130));
|
||||
expect(find.byKey(const Key('recommend-top-nav')), findsOneWidget);
|
||||
expect(tester.getCenter(progress).dy, closeTo(progressCenterY, 0.1));
|
||||
await scrub.up();
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('recommend-top-nav')), findsOneWidget);
|
||||
|
||||
await tester.tap(find.byKey(const Key('recommend-tab-playlist')));
|
||||
await tester.pumpAndSettle();
|
||||
expect(find.byKey(const Key('recommend-section-hits')), findsOneWidget);
|
||||
});
|
||||
|
||||
testWidgets('should_render_playlist_sections_and_horizontal_cards', (
|
||||
|
||||
Reference in new issue
Block a user