|
|
@ -1,5 +1,6 @@
|
|
|
|
// ignore_for_file: prefer_const_constructors
|
|
|
|
// ignore_for_file: prefer_const_constructors
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import 'package:flutter/foundation.dart';
|
|
|
|
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/l10n/l10n.dart';
|
|
|
@ -15,12 +16,24 @@ void main() {
|
|
|
|
l10n = await AppLocalizations.delegate.load(Locale('en'));
|
|
|
|
l10n = await AppLocalizations.delegate.load(Locale('en'));
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
testWidgets('displays content', (tester) async {
|
|
|
|
testWidgets('displays content for desktop', (tester) async {
|
|
|
|
|
|
|
|
debugDefaultTargetPlatformOverride = TargetPlatform.macOS;
|
|
|
|
await tester.pumpApp(HowToPlayDialog());
|
|
|
|
await tester.pumpApp(HowToPlayDialog());
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
|
expect(find.text(l10n.tipsForFlips), findsOneWidget);
|
|
|
|
expect(find.text(l10n.tipsForFlips), findsOneWidget);
|
|
|
|
expect(find.text(l10n.launchControls), findsOneWidget);
|
|
|
|
expect(find.text(l10n.launchControls), findsOneWidget);
|
|
|
|
expect(find.text(l10n.flipperControls), findsOneWidget);
|
|
|
|
expect(find.text(l10n.flipperControls), findsOneWidget);
|
|
|
|
|
|
|
|
debugDefaultTargetPlatformOverride = null;
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
testWidgets('displays content for mobile', (tester) async {
|
|
|
|
|
|
|
|
debugDefaultTargetPlatformOverride = TargetPlatform.iOS;
|
|
|
|
|
|
|
|
await tester.pumpApp(HowToPlayDialog());
|
|
|
|
|
|
|
|
expect(find.text(l10n.howToPlay), findsOneWidget);
|
|
|
|
|
|
|
|
expect(find.text(l10n.tipsForFlips), findsOneWidget);
|
|
|
|
|
|
|
|
expect(find.text(l10n.tapAndHold), findsOneWidget);
|
|
|
|
|
|
|
|
expect(find.text(l10n.tapLeftRightScreen), findsOneWidget);
|
|
|
|
|
|
|
|
debugDefaultTargetPlatformOverride = null;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|