feat(app): 完善播放协议搜索与空状态
This commit is contained in:
1 parent
671e0ce143
commit
ef29fc5f15
85 files changed
+2976
-768
No files matched your search
@@ -0,0 +1,29 @@
|
||||
// Author: fruit.com.cn
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:fruitshorts/pages/player/widgets/player_double_tap_hearts.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('should_show_three_medium_hearts_when_double_tap_burst_starts', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
const MaterialApp(
|
||||
home: Scaffold(body: PlayerDoubleTapHeartBurst(onCompleted: _noop)),
|
||||
),
|
||||
);
|
||||
await tester.pump(const Duration(milliseconds: 160));
|
||||
|
||||
expect(find.byIcon(Icons.favorite_rounded), findsNWidgets(3));
|
||||
expect(_size(tester, 0), 48);
|
||||
expect(_size(tester, 1), 36);
|
||||
expect(_size(tester, 2), 40);
|
||||
});
|
||||
}
|
||||
|
||||
double _size(WidgetTester tester, int index) {
|
||||
return tester.widget<Icon>(find.byKey(Key('double-tap-heart-$index'))).size!;
|
||||
}
|
||||
|
||||
void _noop() {}
|
||||
Reference in new issue
Block a user