Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

First integration test: Sign in with email address and password #175

Merged
merged 15 commits into from
May 16, 2022

Conversation

nilsreichardt
Copy link
Member

@nilsreichardt nilsreichardt commented May 11, 2022

Description

This PR introduces the first integration test. It's a simple one: Sign in with the email address and the password. The main focus of the PR was to set up the integration and fix the errors. Therefore, we can add more integration tests in different PRs.

Demo

Screen.Recording.2022-05-11.at.14.02.54.mov

How to run the integration tests

flutter test \
  integration_test \
  --flavor dev \
  --dart-define \
  USER_1_EMAIL="[email protected]" \
  --dart-define \
  USER_1_PASSWORD="YOUR_PASSWORD"

Native setup for integration tests

I skipped the steps for setting up the iOS and Android device tests, because I think we only need these setups when run our tests with Firebase Test Lab or similar services. Firebase Test Lab needs these steps to properly run the tests. But at the moment, we just run our integration tests with flutter test in emulators/simulators.

Related Tickets

Closes #180

@github-actions
Copy link

github-actions bot commented May 11, 2022

Visit the preview URL for this PR (updated for commit 0ac58f3):

https://sharezone-test--pr175-integration-test-sig-lvbq1x2w.web.app

(expires Mon, 23 May 2022 15:52:23 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

@Jonas-Sander
Copy link
Collaborator

I'm getting build errors :(

Build errors
The plugin `barcode_scan` uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if this plugin supports the Android V2 embedding. Otherwise, consider removing it since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to the V2 embedding: https://flutter.dev/go/android-plugin-migration.
Launching lib/main.dart on iPad Pro (12.9-inch) (4th generation) in debug mode...
Xcode build done.                                           80,4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **
Xcode's output:
↳
    Writing result bundle at path:
    	/var/folders/yg/qsvy65ss0pj1f6b92_42_rs00000gp/T/flutter_tools.xSZ6wT/flutter_ios_build_temp_dircnCiNy/temporary_xcresult_bundle
    1 warning generated.
    1 warning generated.
    4 warnings generated.
    1 warning generated.
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:50:35: warning: 'subscriberCellularProvider' is deprecated: first deprecated in iOS 12.0 [-Wdeprecated-declarations]
        CTCarrier *carrier = [netInfo subscriberCellularProvider];
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                      serviceSubscriberCellularProviders
In module 'CoreTelephony' imported from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: property 'subscriberCellularProvider' is declared deprecated here
    @property(readonly, retain, nullable) CTCarrier *subscriberCellularProvider API_DEPRECATED_WITH_REPLACEMENT("serviceSubscriberCellularProviders", ios(4.0, 12.0)) API_UNAVAILABLE(macos);
                                                     ^
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: 'subscriberCellularProvider' has been explicitly marked deprecated here
    1 warning generated.
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:50:35: warning: 'subscriberCellularProvider' is deprecated: first deprecated in iOS 12.0 [-Wdeprecated-declarations]
        CTCarrier *carrier = [netInfo subscriberCellularProvider];
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~
                                      serviceSubscriberCellularProviders
In module 'CoreTelephony' imported from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/permission_handler-8.3.0/ios/Classes/strategies/PhonePermissionStrategy.m:8:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: property 'subscriberCellularProvider' is declared deprecated here
    @property(readonly, retain, nullable) CTCarrier *subscriberCellularProvider API_DEPRECATED_WITH_REPLACEMENT("serviceSubscriberCellularProviders", ios(4.0, 12.0)) API_UNAVAILABLE(macos);
                                                     ^
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/CoreTelephony.framework/Headers/CTTelephonyNetworkInfo.h:112:50: note: 'subscriberCellularProvider' has been explicitly marked deprecated here
    1 warning generated.
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:97:9: warning: switch covers known cases, but 'EKAuthorizationStatus' may have additional unknown values, possibly added in future versions
            switch authStatus {
            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:97:9: note: handle unknown values using "@unknown default"
            switch authStatus {
            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:138:17: warning: setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
                    UIApplication.shared.statusBarStyle = UIStatusBarStyle.default
                    ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:148:13: warning: setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
                UIApplication.shared.statusBarStyle = statusBarStyle
                ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:97:9: warning: switch covers known cases, but 'EKAuthorizationStatus' may have additional unknown values, possibly added in future versions
            switch authStatus {
            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:97:9: note: handle unknown values using "@unknown default"
            switch authStatus {
            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:138:17: warning: setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
                    UIApplication.shared.statusBarStyle = UIStatusBarStyle.default
                    ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/add_2_calendar-2.1.2/ios/Classes/SwiftAdd2CalendarPlugin.swift:148:13: warning: setter for 'statusBarStyle' was deprecated in iOS 9.0: Use -[UIViewController preferredStatusBarStyle]
                UIApplication.shared.statusBarStyle = statusBarStyle
                ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:149:20: warning: 'flashMode' is deprecated: first deprecated in iOS 10.0 - Use AVCapturePhotoSettings.flashMode instead. [-Wdeprecated-declarations]
                device.flashMode = AVCaptureFlashModeOn;
                       ^
In module 'MTBBarcodeScanner' imported from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.h:6:
    In module 'AVFoundation' imported from /Users/jonassharezone/development/projects/sharezone-app/app/ios/Pods/MTBBarcodeScanner/Classes/ios/Scanners/MTBBarcodeScanner.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:691:41: note: 'flashMode' has been explicitly marked deprecated here
    @property(nonatomic) AVCaptureFlashMode flashMode API_DEPRECATED("Use AVCapturePhotoSettings.flashMode instead.", ios(4.0, 10.0));
                                            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:152:20: warning: 'flashMode' is deprecated: first deprecated in iOS 10.0 - Use AVCapturePhotoSettings.flashMode instead. [-Wdeprecated-declarations]
                device.flashMode = AVCaptureFlashModeOff;
                       ^
In module 'MTBBarcodeScanner' imported from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.h:6:
    In module 'AVFoundation' imported from /Users/jonassharezone/development/projects/sharezone-app/app/ios/Pods/MTBBarcodeScanner/Classes/ios/Scanners/MTBBarcodeScanner.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:691:41: note: 'flashMode' has been explicitly marked deprecated here
    @property(nonatomic) AVCaptureFlashMode flashMode API_DEPRECATED("Use AVCapturePhotoSettings.flashMode instead.", ios(4.0, 10.0));
                                            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:10:17: warning: method definition for 'initWithOptions:' not found [-Wincomplete-implementation]
    @implementation BarcodeScannerViewController {
                    ^
In file included from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:5:
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.h:19:3: note: method 'initWithOptions:' declared here
      -(id) initWithOptions:(NSDictionary *) options;
      ^
    3 warnings generated.
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:149:20: warning: 'flashMode' is deprecated: first deprecated in iOS 10.0 - Use AVCapturePhotoSettings.flashMode instead. [-Wdeprecated-declarations]
                device.flashMode = AVCaptureFlashModeOn;
                       ^
In module 'MTBBarcodeScanner' imported from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.h:6:
    In module 'AVFoundation' imported from /Users/jonassharezone/development/projects/sharezone-app/app/ios/Pods/MTBBarcodeScanner/Classes/ios/Scanners/MTBBarcodeScanner.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:691:41: note: 'flashMode' has been explicitly marked deprecated here
    @property(nonatomic) AVCaptureFlashMode flashMode API_DEPRECATED("Use AVCapturePhotoSettings.flashMode instead.", ios(4.0, 10.0));
                                            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:152:20: warning: 'flashMode' is deprecated: first deprecated in iOS 10.0 - Use AVCapturePhotoSettings.flashMode instead. [-Wdeprecated-declarations]
                device.flashMode = AVCaptureFlashModeOff;
                       ^
In module 'MTBBarcodeScanner' imported from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.h:6:
    In module 'AVFoundation' imported from /Users/jonassharezone/development/projects/sharezone-app/app/ios/Pods/MTBBarcodeScanner/Classes/ios/Scanners/MTBBarcodeScanner.h:9:
    /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator14.4.sdk/System/Library/Frameworks/AVFoundation.framework/Headers/AVCaptureDevice.h:691:41: note: 'flashMode' has been explicitly marked deprecated here
    @property(nonatomic) AVCaptureFlashMode flashMode API_DEPRECATED("Use AVCapturePhotoSettings.flashMode instead.", ios(4.0, 10.0));
                                            ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:10:17: warning: method definition for 'initWithOptions:' not found [-Wincomplete-implementation]
    @implementation BarcodeScannerViewController {
                    ^
In file included from /Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.m:5:
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/barcode_scan-2.0.2/ios/Classes/BarcodeScannerViewController.h:19:3: note: method 'initWithOptions:' declared here
      -(id) initWithOptions:(NSDictionary *) options;
      ^
    3 warnings generated.
    Command CompileSwift failed with a nonzero exit code
    /Users/jonassharezone/development/projects/sharezone-app/app/build/ios/Debug-dev-iphonesimulator/XCFrameworkIntermediates/JitsiMeetSDK/JitsiMeetSDK.framework/Modules/JitsiMeetSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface:10:8: error: no such module '_Concurrency'
    import _Concurrency
           ^
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/jitsi_meet_wrapper-0.0.4/ios/Classes/CustomPiPViewCoordinator.swift:2:8: error: failed to build module 'JitsiMeetSDK' from its module interface; the compiler that produced it, 'Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)'
    import JitsiMeetSDK
           ^
    /Users/jonassharezone/development/projects/sharezone-app/app/build/ios/Debug-dev-iphonesimulator/XCFrameworkIntermediates/JitsiMeetSDK/JitsiMeetSDK.framework/Modules/JitsiMeetSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface:10:8: error: no such module '_Concurrency'
    import _Concurrency
           ^
    note: Using new build system
    note: Building targets in parallel
    note: Planning build
    note: Constructing build description
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Mantle' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'MTBBarcodeScanner' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'FMDB' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'AppAuth' from project 'Pods')
    warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'GoogleSignIn' from project 'Pods')
    Result bundle written to path:
    	/var/folders/yg/qsvy65ss0pj1f6b92_42_rs00000gp/T/flutter_tools.xSZ6wT/flutter_ios_build_temp_dircnCiNy/temporary_xcresult_bundle
Uncategorized (Xcode): Command CompileSwift failed with a nonzero exit code

Swift Compiler Error (Xcode): No such module '_Concurrency'
/Users/jonassharezone/development/projects/sharezone-app/app/build/ios/Debug-dev-iphonesimulator/XCFrameworkIntermediates/JitsiMeetSDK/JitsiMeetSDK.framework/Modules/JitsiMeetSDK.swiftmodule/arm64-apple-ios-simulator.swiftinterface:9:7

Swift Compiler Error (Xcode): Failed to build module 'JitsiMeetSDK' from its module interface; the compiler that produced it, 'Apple Swift version 5.5.2 (swiftlang-1300.0.47.5 clang-1300.0.29.30)', may have used features that aren't supported by this compiler, 'Apple Swift version 5.3.2 (swiftlang-1200.0.45 clang-1200.0.32.28)'
/Users/jonassharezone/.pub-cache/hosted/pub.dartlang.org/jitsi_meet_wrapper-0.0.4/ios/Classes/CustomPiPViewCoordinator.swift:1:7

Could not build the application for the simulator.
Error launching application on iPad Pro (12.9-inch) (4th generation).
Exited (sigterm)

app/integration_test/README.md Outdated Show resolved Hide resolved
Comment on lines +22 to +36
_Note: The integration tests are not working for the web at the moment because we need to migrate our app to null safety. Otherwise, the build will fail because of this message:_
```
org-dartlang-app:/app_test.dart:27:11: Error: Non-nullable variable 'dependencies' must be assigned before it can be used.
await dependencies.blocDependencies.auth.signOut();
^^^^^^^^^^^^
org-dartlang-app:/app_test.dart:34:30: Error: Non-nullable variable 'dependencies' must be assigned before it can be used.
beitrittsversuche: dependencies.beitrittsversuche,
^^^^^^^^^^^^
org-dartlang-app:/app_test.dart:35:29: Error: Non-nullable variable 'dependencies' must be assigned before it can be used.
blocDependencies: dependencies.blocDependencies,
^^^^^^^^^^^^
org-dartlang-app:/app_test.dart:36:28: Error: Non-nullable variable 'dependencies' must be assigned before it can be used.
dynamicLinkBloc: dependencies.dynamicLinkBloc,
^^^^^^^^^^^^
```
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this might happen because on web it runs with null-safety?

Couldn't we either:

  1. Use late for group variables
  late AppDependencies dependencies;
  late _UserCredentials user1;
  1. Pass --no-sound-null-safety explicitly

  2. Make the app_test file use null-safety by using // @dart=2.14

(I haven't tried any of it - just general ideas.)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also tried this, but you will get a different error other packages require null safety.

app/integration_test/app_test.dart Show resolved Hide resolved
app/integration_test/README.md Outdated Show resolved Hide resolved
_UserCredentials user1;

setUpAll(() async {
dependencies = await initializeFlutterApp(isIntegrationTest: true);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem for now but does it fundamentally even make sense that the app returns dependencies? Wouldn't we pass dependencies to the app to run?

I mean it might make sense to pass dependencies and still have a way to access the objects created with those dependencies, I guess? Idk.

Like I said it's okay for now, but it kinda confuses me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we can definitely rework this, but it requires some refactoring in the main.dart because we do so many dirty things in the runFlutterApp method 😅 Therefore, my plan is tough in the app the thing which are blocking the integration tests, write a lot of integration tests and then start refactoring.

app/lib/main/run_app.dart Outdated Show resolved Hide resolved
@nilsreichardt
Copy link
Member Author

@Jonas-Sander Can you re-review?

Copy link
Collaborator

@Jonas-Sander Jonas-Sander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some very small nits, but LGTM. You can merge this if you want.

app/lib/main/run_app.dart Outdated Show resolved Hide resolved
app/lib/main/run_app.dart Outdated Show resolved Hide resolved
Comment on lines 159 to 171
// When the user signs out, we need to dispose the listeners and stream
// subscriptions inside the gateways. Otherwise, we we would cause a
// memory leak and receiving a permission denied error from Firestore
// because we would try to access the user data after the user signed out.
// This would result an instant fail of the integration tests.

if (userGateway != null) {
await userGateway.dispose();
}

if (sharezoneGateway != null) {
await sharezoneGateway.dispose();
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jonas-Sander I have managed to modify SharezoneGateway, UserGateway, ConnectionsGateway, DataDocumentPackage and DataCombinedPackage a bit so that we are able to dispose them correctly (not for the whole app but for the listenToAuthStateChanged listener). Therefore, we can remove is isIntegrationTest flag 🙂

Copy link
Member Author

@nilsreichardt nilsreichardt May 14, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But I need to check manually that this doesn't break anything in the app.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't find any issues for now.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Might it be more readable to do it as a pre-check via if (user.typeOfUser == null) instead of running it inside the else clause?

Also couldn't one do userGateway?.dispose()?

Copy link
Collaborator

@Jonas-Sander Jonas-Sander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments above, only nits though - LGTM

app/lib/util/API.dart Outdated Show resolved Hide resolved
Comment on lines 159 to 171
// When the user signs out, we need to dispose the listeners and stream
// subscriptions inside the gateways. Otherwise, we we would cause a
// memory leak and receiving a permission denied error from Firestore
// because we would try to access the user data after the user signed out.
// This would result an instant fail of the integration tests.

if (userGateway != null) {
await userGateway.dispose();
}

if (sharezoneGateway != null) {
await sharezoneGateway.dispose();
}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: Might it be more readable to do it as a pre-check via if (user.typeOfUser == null) instead of running it inside the else clause?

Also couldn't one do userGateway?.dispose()?

@nilsreichardt
Copy link
Member Author

Nit: Might it be more readable to do it as a pre-check via if (user.typeOfUser == null) instead of running it inside the else clause?

Also couldn't one do userGateway?.dispose()?

I don't why but I can't answer to your comment, so I'm adding a new comment.

I would keep in the else clause and use userGateway?.dispose()

@nilsreichardt nilsreichardt merged commit 4f9c22d into main May 16, 2022
@nilsreichardt nilsreichardt deleted the integration-test-sign-in branch May 16, 2022 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Set up integration tests
2 participants