fix(flutter): 首页 feed 静默刷新与进度条细节

This commit is contained in:
Zhou Weidong committed 2026-10-20 14:11:42 +08:00
1 parent a3126723d2
commit 82fe237c24
8 files changed
+190 -17

No files matched your search

+44
View File
@@ -211,6 +211,12 @@ void main() {
final bar = tester.getRect(find.byKey(const Key('home-feed-full-series')));
expect(bar.height, 44);
expect(
tester
.widget<Container>(find.byKey(const Key('home-feed-full-series-bg')))
.color,
const Color(0x4D000000),
);
expect(
tester.getRect(find.textContaining('Watch full series')).center.dy,
closeTo(bar.center.dy, 2),
@@ -219,6 +225,23 @@ void main() {
tester.getSize(find.byKey(const Key('home-feed-progress-thumb'))),
const Size(6, 6),
);
expect(
tester.getSize(find.byKey(const Key('home-feed-progress'))).height,
greaterThanOrEqualTo(24),
);
expect(
tester
.getRect(find.byKey(const Key('home-feed-progress-thumb')))
.center
.dy,
closeTo(
tester
.getRect(find.byKey(const Key('home-feed-progress-track')))
.center
.dy,
0.5,
),
);
await tester.tap(find.byKey(const Key('home-feed-refresh')));
await tester.pump();
@@ -233,6 +256,23 @@ void main() {
tester.getSize(find.byKey(const Key('home-feed-progress-thumb'))),
const Size(10, 10),
);
expect(
tester.getSize(find.byKey(const Key('home-feed-progress-track'))).height,
4,
);
expect(
tester
.getRect(find.byKey(const Key('home-feed-progress-thumb')))
.center
.dy,
closeTo(
tester
.getRect(find.byKey(const Key('home-feed-progress-track')))
.center
.dy,
0.5,
),
);
await gesture.up();
await tester.pumpAndSettle();
expect(seeked, isNotNull);
@@ -241,6 +281,10 @@ void main() {
tester.getSize(find.byKey(const Key('home-feed-progress-thumb'))),
const Size(6, 6),
);
expect(
tester.getSize(find.byKey(const Key('home-feed-progress-track'))).height,
2,
);
await tester.tap(find.byKey(const Key('home-feed-full-series')));
await tester.pump();