fix(player): 恢复独立播放页双击点赞
This commit is contained in:
1 parent
b291044acc
commit
63296d2a92
8 files changed
+348
-145
No files matched your search
@@ -12,8 +12,8 @@ import '../support/fake_haptics.dart';
|
||||
import '../support/fake_interaction_repositories.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('double tap within 400ms never pauses', (tester) async {
|
||||
for (final delay in [120, 250, 300, 380]) {
|
||||
testWidgets('double tap within 320ms never pauses', (tester) async {
|
||||
for (final delay in [120, 250, 300]) {
|
||||
final repository = FakeInteractionRepository();
|
||||
final haptics = FakeHaptics();
|
||||
final key = GlobalKey<_HarnessState>();
|
||||
@@ -74,6 +74,39 @@ void main() {
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
expect(key.currentState!.pauseToggles, 2);
|
||||
});
|
||||
|
||||
testWidgets('liked episode keeps heart feedback without liking again', (
|
||||
tester,
|
||||
) async {
|
||||
final repository = FakeInteractionRepository();
|
||||
final haptics = FakeHaptics();
|
||||
final key = GlobalKey<_HarnessState>();
|
||||
final clock = _TestClock();
|
||||
await _pumpHarness(tester, repository, haptics, key, clock);
|
||||
final center = tester.getCenter(find.byKey(const Key('home-feed-gesture')));
|
||||
|
||||
await tester.tapAt(center);
|
||||
clock.advance(const Duration(milliseconds: 100));
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.tapAt(center);
|
||||
await tester.pump();
|
||||
expect(repository.likeTargets, hasLength(1));
|
||||
await tester.pump(const Duration(milliseconds: 800));
|
||||
|
||||
clock.advance(const Duration(milliseconds: 500));
|
||||
await tester.pump(const Duration(milliseconds: 500));
|
||||
await tester.tapAt(center);
|
||||
clock.advance(const Duration(milliseconds: 100));
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
await tester.tapAt(center);
|
||||
await tester.pump();
|
||||
await tester.pump(const Duration(milliseconds: 100));
|
||||
|
||||
expect(repository.likeTargets, hasLength(1));
|
||||
expect(haptics.lightImpacts, 2);
|
||||
expect(key.currentState!.pauseToggles, 0);
|
||||
expect(find.byKey(const Key('double-tap-heart-0')), findsOneWidget);
|
||||
});
|
||||
}
|
||||
|
||||
Future<void> _pumpHarness(
|
||||
|
||||
Reference in new issue
Block a user