fix(recommend): 恢复进度拖动前浮层状态

This commit is contained in:
Zhou Weidong committed 2026-10-22 20:08:45 +08:00
1 parent c478eebb0e
commit b6666290ba
7 files changed
+47 -43

No files matched your search

+24 -7
View File
@@ -719,6 +719,28 @@ void main() {
tester.getRect(find.byKey(const Key('home-feed-gesture'))).right - 12,
),
);
expect(
tester
.getRect(find.byKey(const Key('home-feed-progress-track')))
.center
.dy -
bubbleRect.bottom,
closeTo(16, 0.1),
);
final bubbleContainer = tester.widget<Container>(
find.descendant(
of: find.byKey(const Key('scrub-preview-time-bubble')),
matching: find.byType(Container),
),
);
expect(
(bubbleContainer.decoration! as BoxDecoration).color,
AppColors.timeBubbleScrim,
);
expect(
bubbleContainer.padding,
const EdgeInsets.symmetric(horizontal: 6, vertical: 3),
);
await gesture.moveBy(const Offset(-600, 0));
await tester.pump();
expect(
@@ -765,8 +787,8 @@ void main() {
);
await gesture.up();
await tester.pumpAndSettle();
expect(scrubVisibility.last, isTrue);
expect(find.byKey(const Key('home-feed-title')), findsNothing);
expect(scrubVisibility.last, isFalse);
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
expect(seeked, isNotNull);
expect(seeked!.inSeconds, greaterThan(0));
expect(
@@ -778,11 +800,6 @@ void main() {
2,
);
await tester.tap(find.byKey(const Key('home-feed-gesture')));
await tester.pump();
expect(scrubVisibility.last, isFalse);
expect(find.byKey(const Key('home-feed-title')), findsOneWidget);
await tester.tap(find.byKey(const Key('home-feed-full-series')));
await tester.pump();
expect(opened, 1);
@@ -102,9 +102,15 @@ void main() {
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));
final navVisibility = find.ancestor(
of: find.byKey(const Key('home-tabs-bar')),
matching: find.byType(Visibility),
);
expect(tester.widget<Visibility>(navVisibility.first).visible, isFalse);
await scrub.up();
await tester.pumpAndSettle();
expect(find.byKey(const Key('recommend-top-nav')), findsOneWidget);
expect(tester.widget<Visibility>(navVisibility.first).visible, isTrue);
await tester.tap(find.byKey(const Key('recommend-tab-playlist')));
await tester.pumpAndSettle();