enable desktop in integration tests

This commit is contained in:
Adam Velebil 2022-04-27 13:42:36 +02:00
parent aef3987a8c
commit b8b41830d2
No known key found for this signature in database
GPG Key ID: AC6D6B9D715FC084

View File

@ -7,6 +7,8 @@ import 'package:integration_test/integration_test.dart';
import 'package:yubico_authenticator/android/init.dart' as android;
import 'package:yubico_authenticator/app/logging.dart';
import 'package:yubico_authenticator/app/views/no_device_screen.dart';
import 'package:yubico_authenticator/core/state.dart';
import 'package:yubico_authenticator/desktop/init.dart' as desktop;
import 'package:yubico_authenticator/oath/views/account_list.dart';
import 'package:yubico_authenticator/oath/views/oath_screen.dart';
@ -44,7 +46,15 @@ void main() {
testWidgets('Add account', (WidgetTester tester) async {
final logBuffer = initLogBuffer(1000);
final initializedApp = await android.initialize();
final Widget initializedApp;
if (isDesktop) {
initializedApp = await desktop.initialize();
} else if (isAndroid) {
initializedApp = await android.initialize();
} else {
throw UnimplementedError('Platform not supported');
}
await tester.pumpWidget(LogBuffer(
logBuffer,
child: initializedApp,