Skip to content

Commit

Permalink
Update dart tests and mocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Widcket committed Mar 19, 2024
1 parent d050b19 commit 4bea3d2
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
3 changes: 3 additions & 0 deletions sample/test/widget_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ AUTH0_CLIENT_ID=bar
redirectUrl: anyNamed('redirectUrl'),
scopes: anyNamed('scopes'),
parameters: anyNamed('parameters'),
useHTTPS: anyNamed('useHTTPS'),
useEphemeralSession: anyNamed('useEphemeralSession'),
idTokenValidationConfig: anyNamed('idTokenValidationConfig'),
)).thenAnswer((_) => Future.value(Credentials.fromMap({
Expand Down Expand Up @@ -65,6 +66,7 @@ AUTH0_CLIENT_ID=bar
redirectUrl: anyNamed('redirectUrl'),
scopes: anyNamed('scopes'),
parameters: anyNamed('parameters'),
useHTTPS: anyNamed('useHTTPS'),
useEphemeralSession: anyNamed('useEphemeralSession'),
idTokenValidationConfig: anyNamed('idTokenValidationConfig'),
)).called(1);
Expand All @@ -83,6 +85,7 @@ AUTH0_CLIENT_ID=bar
await tester.pumpAndSettle();

verify(mockedWebAuth.logout(
useHTTPS: anyNamed('useHTTPS'),
returnTo: anyNamed('returnTo'),
)).called(1);

Expand Down
21 changes: 18 additions & 3 deletions sample/test/widget_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Mocks generated by Mockito 5.4.0 from annotations
// Mocks generated by Mockito 5.4.4 from annotations
// in sample/test/widget_test.dart.
// Do not manually edit this file.

Expand All @@ -17,6 +17,8 @@ import 'package:mockito/mockito.dart' as _i1;
// ignore_for_file: avoid_redundant_argument_values
// ignore_for_file: avoid_setters_without_getters
// ignore_for_file: comment_references
// ignore_for_file: deprecated_member_use
// ignore_for_file: deprecated_member_use_from_same_package
// ignore_for_file: implementation_imports
// ignore_for_file: invalid_use_of_visible_for_testing_member
// ignore_for_file: prefer_const_constructors
Expand Down Expand Up @@ -83,6 +85,7 @@ class MockAuth0 extends _i1.Mock implements _i6.Auth0 {
Invocation.getter(#credentialsManager),
),
) as _i2.CredentialsManager);

@override
_i3.AuthenticationApi get api => (super.noSuchMethod(
Invocation.getter(#api),
Expand All @@ -91,6 +94,7 @@ class MockAuth0 extends _i1.Mock implements _i6.Auth0 {
Invocation.getter(#api),
),
) as _i3.AuthenticationApi);

@override
_i4.WebAuthentication webAuthentication({
String? scheme,
Expand Down Expand Up @@ -139,6 +143,7 @@ class MockWebAuthentication extends _i1.Mock implements _i4.WebAuthentication {
String? redirectUrl,
String? organizationId,
String? invitationUrl,
bool? useHTTPS = false,
bool? useEphemeralSession = false,
Map<String, String>? parameters = const {},
_i5.IdTokenValidationConfig? idTokenValidationConfig =
Expand All @@ -155,6 +160,7 @@ class MockWebAuthentication extends _i1.Mock implements _i4.WebAuthentication {
#redirectUrl: redirectUrl,
#organizationId: organizationId,
#invitationUrl: invitationUrl,
#useHTTPS: useHTTPS,
#useEphemeralSession: useEphemeralSession,
#parameters: parameters,
#idTokenValidationConfig: idTokenValidationConfig,
Expand All @@ -172,6 +178,7 @@ class MockWebAuthentication extends _i1.Mock implements _i4.WebAuthentication {
#redirectUrl: redirectUrl,
#organizationId: organizationId,
#invitationUrl: invitationUrl,
#useHTTPS: useHTTPS,
#useEphemeralSession: useEphemeralSession,
#parameters: parameters,
#idTokenValidationConfig: idTokenValidationConfig,
Expand All @@ -180,12 +187,20 @@ class MockWebAuthentication extends _i1.Mock implements _i4.WebAuthentication {
),
)),
) as _i7.Future<_i5.Credentials>);

@override
_i7.Future<void> logout({String? returnTo}) => (super.noSuchMethod(
_i7.Future<void> logout({
String? returnTo,
bool? useHTTPS = false,
}) =>
(super.noSuchMethod(
Invocation.method(
#logout,
[],
{#returnTo: returnTo},
{
#returnTo: returnTo,
#useHTTPS: useHTTPS,
},
),
returnValue: _i7.Future<void>.value(),
returnValueForMissingStub: _i7.Future<void>.value(),
Expand Down

0 comments on commit 4bea3d2

Please sign in to comment.