fix: update tests

pull/245/head
arturplaczek 3 years ago
parent a682b62ada
commit d6e0c01bba

@ -14,7 +14,7 @@ class HowToPlayDialog extends StatelessWidget {
return PinballDialogLayout( return PinballDialogLayout(
header: Text(l10n.howToPlay), header: Text(l10n.howToPlay),
body: Column( body: ListView(
children: const [ children: const [
spacing, spacing,
_LaunchControls(), _LaunchControls(),
@ -38,9 +38,7 @@ class _LaunchControls extends StatelessWidget {
children: [ children: [
Text(l10n.launchControls), Text(l10n.launchControls),
const SizedBox(height: 10), const SizedBox(height: 10),
Row( Wrap(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: const [ children: const [
KeyIndicator.fromIcon(keyIcon: Icons.keyboard_arrow_down), KeyIndicator.fromIcon(keyIcon: Icons.keyboard_arrow_down),
spacing, spacing,
@ -78,9 +76,7 @@ class _FlipperControls extends StatelessWidget {
], ],
), ),
const SizedBox(height: 8), const SizedBox(height: 8),
Row( Wrap(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center,
children: const [ children: const [
KeyIndicator.fromKeyName(keyName: 'A'), KeyIndicator.fromKeyName(keyName: 'A'),
rowSpacing, rowSpacing,

@ -2,16 +2,19 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart'; import 'package:flutter_test/flutter_test.dart';
import 'package:pinball/l10n/l10n.dart';
import 'package:pinball/start_game/start_game.dart'; import 'package:pinball/start_game/start_game.dart';
import '../../helpers/helpers.dart'; import '../../helpers/helpers.dart';
void main() { void main() {
group('HowToPlayDialog', () { group('HowToPlayDialog', () {
testWidgets('displays dialog', (tester) async { testWidgets('displays content', (tester) async {
final l10n = await AppLocalizations.delegate.load(Locale('en'));
await tester.pumpApp(HowToPlayDialog()); await tester.pumpApp(HowToPlayDialog());
expect(find.byType(Dialog), findsOneWidget); expect(find.text(l10n.launchControls), findsOneWidget);
}); });
}); });

Loading…
Cancel
Save