feat: New Open Tab dialog with search and optional customer email. Drinks are now grouped per order. Payments trigger cha-ching and money rain.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:kooltap/views/widgets/money_rain.dart';
|
||||
|
||||
void main() {
|
||||
testWidgets('money rain covers the screen for three seconds', (
|
||||
tester,
|
||||
) async {
|
||||
await tester.pumpWidget(
|
||||
MaterialApp(
|
||||
home: Builder(
|
||||
builder: (context) => TextButton(
|
||||
onPressed: () => showMoneyRain(context),
|
||||
child: const Text('Pay'),
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
|
||||
await tester.tap(find.text('Pay'));
|
||||
await tester.pump();
|
||||
expect(find.byType(IgnorePointer), findsWidgets);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 1500));
|
||||
final painted = find.byWidgetPredicate(
|
||||
(widget) => widget is CustomPaint && widget.size == Size.infinite,
|
||||
);
|
||||
expect(painted, findsOneWidget);
|
||||
|
||||
await tester.pump(const Duration(milliseconds: 1600));
|
||||
await tester.pump();
|
||||
expect(painted, findsNothing);
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user