fix: 修复播放器重复暂停手势
This commit is contained in:
1 parent
76c4b528d3
commit
5794dd4e4d
5 files changed
+52
-32
No files matched your search
@@ -24,7 +24,8 @@ void main() {
|
||||
await tester.tapAt(center);
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.tapAt(center);
|
||||
await tester.pumpAndSettle();
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
|
||||
expect(key.currentState!.pauseToggles, 0);
|
||||
expect(repository.likeTargets, hasLength(1));
|
||||
@@ -36,19 +37,17 @@ void main() {
|
||||
),
|
||||
findsOneWidget,
|
||||
);
|
||||
await tester.pumpAndSettle();
|
||||
});
|
||||
|
||||
testWidgets('single tap toggles playback after 280ms', (tester) async {
|
||||
testWidgets('single tap toggles playback after 300ms', (tester) async {
|
||||
final key = GlobalKey<_HarnessState>();
|
||||
await _pumpHarness(tester, FakeInteractionRepository(), FakeHaptics(), key);
|
||||
|
||||
await tester.tapAt(
|
||||
tester.getCenter(find.byKey(const Key('home-feed-gesture'))),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 279));
|
||||
expect(key.currentState!.pauseToggles, 0);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 2));
|
||||
await tester.pump(const Duration(milliseconds: 400));
|
||||
expect(key.currentState!.pauseToggles, 1);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user