|
|
@ -25,7 +25,11 @@ void main() {
|
|
|
|
testWidgets(
|
|
|
|
testWidgets(
|
|
|
|
'can be instantiated without passing in a platform helper',
|
|
|
|
'can be instantiated without passing in a platform helper',
|
|
|
|
(tester) async {
|
|
|
|
(tester) async {
|
|
|
|
await tester.pumpApp(HowToPlayDialog());
|
|
|
|
await tester.pumpApp(
|
|
|
|
|
|
|
|
HowToPlayDialog(
|
|
|
|
|
|
|
|
onDismissCallback: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
);
|
|
|
|
expect(find.byType(HowToPlayDialog), findsOneWidget);
|
|
|
|
expect(find.byType(HowToPlayDialog), findsOneWidget);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
);
|
|
|
|
);
|
|
|
@ -35,6 +39,7 @@ void main() {
|
|
|
|
await tester.pumpApp(
|
|
|
|
await tester.pumpApp(
|
|
|
|
HowToPlayDialog(
|
|
|
|
HowToPlayDialog(
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
|
|
|
|
onDismissCallback: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
@ -49,6 +54,7 @@ void main() {
|
|
|
|
await tester.pumpApp(
|
|
|
|
await tester.pumpApp(
|
|
|
|
HowToPlayDialog(
|
|
|
|
HowToPlayDialog(
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
platformHelper: platformHelper,
|
|
|
|
|
|
|
|
onDismissCallback: () {},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
@ -62,7 +68,12 @@ void main() {
|
|
|
|
Builder(
|
|
|
|
Builder(
|
|
|
|
builder: (context) {
|
|
|
|
builder: (context) {
|
|
|
|
return TextButton(
|
|
|
|
return TextButton(
|
|
|
|
onPressed: () => showHowToPlayDialog(context),
|
|
|
|
onPressed: () => showDialog<void>(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder: (_) => HowToPlayDialog(
|
|
|
|
|
|
|
|
onDismissCallback: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
child: const Text('test'),
|
|
|
|
child: const Text('test'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -82,7 +93,12 @@ void main() {
|
|
|
|
Builder(
|
|
|
|
Builder(
|
|
|
|
builder: (context) {
|
|
|
|
builder: (context) {
|
|
|
|
return TextButton(
|
|
|
|
return TextButton(
|
|
|
|
onPressed: () => showHowToPlayDialog(context),
|
|
|
|
onPressed: () => showDialog<void>(
|
|
|
|
|
|
|
|
context: context,
|
|
|
|
|
|
|
|
builder: (_) => HowToPlayDialog(
|
|
|
|
|
|
|
|
onDismissCallback: () {},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
),
|
|
|
|
child: const Text('test'),
|
|
|
|
child: const Text('test'),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
},
|
|
|
|
},
|
|
|
@ -96,30 +112,5 @@ void main() {
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
expect(find.byType(HowToPlayDialog), findsNothing);
|
|
|
|
expect(find.byType(HowToPlayDialog), findsNothing);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
testWidgets(
|
|
|
|
|
|
|
|
'plays the I/O Pinball voice over audio on dismiss',
|
|
|
|
|
|
|
|
(tester) async {
|
|
|
|
|
|
|
|
final audio = _MockPinballAudio();
|
|
|
|
|
|
|
|
await tester.pumpApp(
|
|
|
|
|
|
|
|
Builder(
|
|
|
|
|
|
|
|
builder: (context) {
|
|
|
|
|
|
|
|
return TextButton(
|
|
|
|
|
|
|
|
onPressed: () => showHowToPlayDialog(context),
|
|
|
|
|
|
|
|
child: const Text('test'),
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
),
|
|
|
|
|
|
|
|
pinballAudio: audio,
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
expect(find.byType(HowToPlayDialog), findsNothing);
|
|
|
|
|
|
|
|
await tester.tap(find.text('test'));
|
|
|
|
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
await tester.tapAt(Offset.zero);
|
|
|
|
|
|
|
|
await tester.pumpAndSettle();
|
|
|
|
|
|
|
|
verify(audio.ioPinballVoiceOver).called(1);
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|