Skip to content

Commit

Permalink
fix: failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dshukertjr committed Aug 1, 2022
1 parent 3fceb48 commit 18189ed
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions test/widget_test_stubs.dart
Expand Up @@ -45,7 +45,7 @@ class MockLocalStorage extends LocalStorage {

/// Session expires at is at its maximum value for unix timestamp
accessToken: () async =>
'{"currentSession":{"access_token":"","expires_in":3600,"refresh_token":"","user":{"id":"","aud":"","created_at":"","role":"authenticated","updated_at":""}},"expiresAt":2147483647}',
'{"currentSession":{"token_type": "","access_token":"","expires_in":3600,"refresh_token":"","user":{"id":"","aud":"","created_at":"","role":"authenticated","updated_at":""}},"expiresAt":2147483647}',
persistSession: (_) async {},
removePersistedSession: () async {},
hasAccessToken: () async => true,
Expand All @@ -55,10 +55,13 @@ class MockLocalStorage extends LocalStorage {
// Register the mock handler for uni_links
void mockAppLink() {
const channel = MethodChannel('com.llfbandit.app_links/messages');
const anotherChannel = MethodChannel('com.llfbandit.app_links/events');

TestWidgetsFlutterBinding.ensureInitialized();

TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger
.setMockMethodCallHandler(channel, (call) {
return null;
});
.setMockMethodCallHandler(channel, (call) => null);

TestDefaultBinaryMessengerBinding.instance?.defaultBinaryMessenger
.setMockMethodCallHandler(anotherChannel, (message) => null);
}

0 comments on commit 18189ed

Please sign in to comment.