chore: add integration tests

Signed-off-by: TheOneWithTheBraid <the-one@with-the-braid.cf>
This commit is contained in:
TheOneWithTheBraid 2022-12-29 15:02:29 +01:00
parent ba885ca69e
commit 710b793c0f
3 changed files with 79 additions and 17 deletions

View File

@ -32,24 +32,24 @@ extension DefaultFlowExtensions on WidgetTester {
await tester.pumpAndSettle(); await tester.pumpAndSettle();
// in case registration is allowed // in case registration is allowed
// try { try {
await Future.delayed(const Duration(milliseconds: 50)); await Future.delayed(const Duration(milliseconds: 50));
await tester.scrollUntilVisible( await tester.scrollUntilVisible(
find.text('Login'), find.text('Login'),
500, 500,
scrollable: find.descendant( scrollable: find.descendant(
of: find.byKey(const Key('ConnectPageListView')), of: find.byKey(const Key('ConnectPageListView')),
matching: find.byType(Scrollable).first, matching: find.byType(Scrollable).first,
), ),
); );
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await tester.tap(find.text('Login')); await tester.tap(find.text('Login'));
await tester.pumpAndSettle(); await tester.pumpAndSettle();
/*} catch (e) { } catch (e) {
log('Registration is not allowed. Proceeding with login...'); log('Registration is not allowed. Proceeding with login...');
}*/ }
await tester.pumpAndSettle(); await tester.pumpAndSettle();
await Future.delayed(const Duration(milliseconds: 50)); await Future.delayed(const Duration(milliseconds: 50));

View File

@ -0,0 +1,57 @@
//
// Generated file. Do not edit.
//
// ignore_for_file: directives_ordering
// ignore_for_file: lines_longer_than_80_chars
// ignore_for_file: depend_on_referenced_packages
import 'package:audio_session/audio_session_web.dart';
import 'package:connectivity_plus_web/connectivity_plus_web.dart';
import 'package:desktop_drop/desktop_drop_web.dart';
import 'package:device_info_plus_web/device_info_plus_web.dart';
import 'package:file_picker/_internal/file_picker_web.dart';
import 'package:file_selector_web/file_selector_web.dart';
import 'package:flutter_keyboard_visibility_web/flutter_keyboard_visibility_web.dart';
import 'package:flutter_native_splash/flutter_native_splash_web.dart';
import 'package:flutter_secure_storage_web/flutter_secure_storage_web.dart';
import 'package:flutter_web_auth/src/flutter_web_auth_web.dart';
import 'package:geolocator_web/geolocator_web.dart';
import 'package:image_picker_for_web/image_picker_for_web.dart';
import 'package:just_audio_web/just_audio_web.dart';
import 'package:package_info_plus_web/package_info_plus_web.dart';
import 'package:record_web/record_web.dart';
import 'package:share_plus_web/share_plus_web.dart';
import 'package:shared_preferences_web/shared_preferences_web.dart';
import 'package:uni_links_web/uni_links_web.dart';
import 'package:url_launcher_web/url_launcher_web.dart';
import 'package:video_player_web/video_player_web.dart';
import 'package:wakelock_web/wakelock_web.dart';
import 'package:flutter_web_plugins/flutter_web_plugins.dart';
// ignore: public_member_api_docs
void registerPlugins(Registrar registrar) {
AudioSessionWeb.registerWith(registrar);
ConnectivityPlusPlugin.registerWith(registrar);
DesktopDropWeb.registerWith(registrar);
DeviceInfoPlusPlugin.registerWith(registrar);
FilePickerWeb.registerWith(registrar);
FileSelectorWeb.registerWith(registrar);
FlutterKeyboardVisibilityPlugin.registerWith(registrar);
FlutterNativeSplashWeb.registerWith(registrar);
FlutterSecureStorageWeb.registerWith(registrar);
FlutterWebAuthPlugin.registerWith(registrar);
GeolocatorPlugin.registerWith(registrar);
ImagePickerPlugin.registerWith(registrar);
JustAudioPlugin.registerWith(registrar);
PackageInfoPlugin.registerWith(registrar);
RecordPluginWeb.registerWith(registrar);
SharePlusPlugin.registerWith(registrar);
SharedPreferencesPlugin.registerWith(registrar);
UniLinksPlugin.registerWith(registrar);
UrlLauncherPlugin.registerWith(registrar);
VideoPlayerPlugin.registerWith(registrar);
WakelockWeb.registerWith(registrar);
registrar.registerMessageHandler();
}

View File

@ -240,8 +240,13 @@ class MatrixState extends State<Matrix> with WidgetsBindingObserver {
bool webHasFocus = true; bool webHasFocus = true;
String? get activeRoomId => String? get activeRoomId {
VRouter.of(navigatorContext).pathParameters['roomid']; try {
return VRouter.of(navigatorContext).pathParameters['roomid'];
} catch (_) {
return null;
}
}
final linuxNotifications = final linuxNotifications =
PlatformInfos.isLinux ? NotificationsClient() : null; PlatformInfos.isLinux ? NotificationsClient() : null;