Skip to content

Commit

Permalink
fix: testing ignored false
Browse files Browse the repository at this point in the history
  • Loading branch information
roiskhoiron committed May 27, 2024
1 parent dcfffcd commit 67a1ec8
Show file tree
Hide file tree
Showing 11 changed files with 611 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ migrate_working_dir/
*.ipr
*.iws
.idea/
*.mocks.dart
#*.mocks.dart

# The .vscode folder contains launch configuration and tasks you configure in
# VS Code which you may wish to be included in version control, so this line
Expand Down
Binary file added test/golden_test/goldens/login_page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
76 changes: 76 additions & 0 deletions test/integration_test/presentation/login_page_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Mocks generated by Mockito 5.4.3 from annotations
// in t_ddd_flutter/test/presentation/login_page_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;

import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i7;
import 'package:t_ddd_flutter/application/user_service.dart' as _i3;
import 'package:t_ddd_flutter/domain/entities/login_request.dart' as _i5;
import 'package:t_ddd_flutter/domain/entities/login_response.dart' as _i2;
import 'package:t_ddd_flutter/domain/entities/user.dart' as _i6;

// ignore_for_file: type=lint
// 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
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

class _FakeLoginResponse_0 extends _i1.SmartFake implements _i2.LoginResponse {
_FakeLoginResponse_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

/// A class which mocks [UserService].
///
/// See the documentation for Mockito's code generation for more information.
class MockUserService extends _i1.Mock implements _i3.UserService {
MockUserService() {
_i1.throwOnMissingStub(this);
}

@override
_i4.Future<_i2.LoginResponse> login(_i5.LoginRequest? request) =>
(super.noSuchMethod(
Invocation.method(
#login,
[request],
),
returnValue: _i4.Future<_i2.LoginResponse>.value(_FakeLoginResponse_0(
this,
Invocation.method(
#login,
[request],
),
)),
) as _i4.Future<_i2.LoginResponse>);

@override
String generateToken(_i6.User? user) => (super.noSuchMethod(
Invocation.method(
#generateToken,
[user],
),
returnValue: _i7.dummyValue<String>(
this,
Invocation.method(
#generateToken,
[user],
),
),
) as String);
}
27 changes: 27 additions & 0 deletions test/main_test.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// This is a basic Flutter widget test.
//
// To perform an interaction with a widget in your test, use the WidgetTester
// utility in the flutter_test package. For example, you can send tap and scroll
// gestures. You can also use WidgetTester to find child widgets in the widget
// tree, read text, and verify that the values of widget properties are correct.



void main() {
// testWidgets('Counter increments smoke test', (WidgetTester tester) async {
// // Build our app and trigger a frame.
// await tester.pumpWidget(const MyApp());

// // Verify that our counter starts at 0.
// expect(find.text('0'), findsOneWidget);
// expect(find.text('1'), findsNothing);

// // Tap the '+' icon and trigger a frame.
// await tester.tap(find.byIcon(Icons.add));
// await tester.pump();

// // Verify that our counter has incremented.
// expect(find.text('0'), findsNothing);
// expect(find.text('1'), findsOneWidget);
// });
}
76 changes: 76 additions & 0 deletions test/unit_test/application/user_service_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
// Mocks generated by Mockito 5.4.3 from annotations
// in t_ddd_flutter/test/application/user_service_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i4;

import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i7;
import 'package:t_ddd_flutter/application/user_service.dart' as _i3;
import 'package:t_ddd_flutter/domain/entities/login_request.dart' as _i5;
import 'package:t_ddd_flutter/domain/entities/login_response.dart' as _i2;
import 'package:t_ddd_flutter/domain/entities/user.dart' as _i6;

// ignore_for_file: type=lint
// 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
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

class _FakeLoginResponse_0 extends _i1.SmartFake implements _i2.LoginResponse {
_FakeLoginResponse_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

/// A class which mocks [UserService].
///
/// See the documentation for Mockito's code generation for more information.
class MockUserService extends _i1.Mock implements _i3.UserService {
MockUserService() {
_i1.throwOnMissingStub(this);
}

@override
_i4.Future<_i2.LoginResponse> login(_i5.LoginRequest? request) =>
(super.noSuchMethod(
Invocation.method(
#login,
[request],
),
returnValue: _i4.Future<_i2.LoginResponse>.value(_FakeLoginResponse_0(
this,
Invocation.method(
#login,
[request],
),
)),
) as _i4.Future<_i2.LoginResponse>);

@override
String generateToken(_i6.User? user) => (super.noSuchMethod(
Invocation.method(
#generateToken,
[user],
),
returnValue: _i7.dummyValue<String>(
this,
Invocation.method(
#generateToken,
[user],
),
),
) as String);
}
66 changes: 66 additions & 0 deletions test/unit_test/domain/entities/login_request_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
// Mocks generated by Mockito 5.4.3 from annotations
// in t_ddd_flutter/test/domain/entities/login_request_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i3;
import 'package:t_ddd_flutter/domain/entities/login_request.dart' as _i2;

// ignore_for_file: type=lint
// 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
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

/// A class which mocks [LoginRequest].
///
/// See the documentation for Mockito's code generation for more information.
class MockLoginRequest extends _i1.Mock implements _i2.LoginRequest {
MockLoginRequest() {
_i1.throwOnMissingStub(this);
}

@override
String get username => (super.noSuchMethod(
Invocation.getter(#username),
returnValue: _i3.dummyValue<String>(
this,
Invocation.getter(#username),
),
) as String);

@override
set username(String? _username) => super.noSuchMethod(
Invocation.setter(
#username,
_username,
),
returnValueForMissingStub: null,
);

@override
String get password => (super.noSuchMethod(
Invocation.getter(#password),
returnValue: _i3.dummyValue<String>(
this,
Invocation.getter(#password),
),
) as String);

@override
set password(String? _password) => super.noSuchMethod(
Invocation.setter(
#password,
_password,
),
returnValueForMissingStub: null,
);
}
77 changes: 77 additions & 0 deletions test/unit_test/domain/entities/login_response_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
// Mocks generated by Mockito 5.4.3 from annotations
// in t_ddd_flutter/test/domain/entities/login_response_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'package:mockito/mockito.dart' as _i1;
import 'package:mockito/src/dummies.dart' as _i4;
import 'package:t_ddd_flutter/domain/entities/login_response.dart' as _i3;
import 'package:t_ddd_flutter/domain/entities/user.dart' as _i2;

// ignore_for_file: type=lint
// 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
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

class _FakeUser_0 extends _i1.SmartFake implements _i2.User {
_FakeUser_0(
Object parent,
Invocation parentInvocation,
) : super(
parent,
parentInvocation,
);
}

/// A class which mocks [LoginResponse].
///
/// See the documentation for Mockito's code generation for more information.
class MockLoginResponse extends _i1.Mock implements _i3.LoginResponse {
MockLoginResponse() {
_i1.throwOnMissingStub(this);
}

@override
String get token => (super.noSuchMethod(
Invocation.getter(#token),
returnValue: _i4.dummyValue<String>(
this,
Invocation.getter(#token),
),
) as String);

@override
set token(String? _token) => super.noSuchMethod(
Invocation.setter(
#token,
_token,
),
returnValueForMissingStub: null,
);

@override
_i2.User get user => (super.noSuchMethod(
Invocation.getter(#user),
returnValue: _FakeUser_0(
this,
Invocation.getter(#user),
),
) as _i2.User);

@override
set user(_i2.User? _user) => super.noSuchMethod(
Invocation.setter(
#user,
_user,
),
returnValueForMissingStub: null,
);
}
57 changes: 57 additions & 0 deletions test/unit_test/domain/interface/user_repository_test.mocks.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// Mocks generated by Mockito 5.4.3 from annotations
// in t_ddd_flutter/test/domain/interface/user_repository_test.dart.
// Do not manually edit this file.

// ignore_for_file: no_leading_underscores_for_library_prefixes
import 'dart:async' as _i3;

import 'package:mockito/mockito.dart' as _i1;
import 'package:t_ddd_flutter/domain/entities/user.dart' as _i4;
import 'package:t_ddd_flutter/domain/interface/user_repository.dart' as _i2;

// ignore_for_file: type=lint
// 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
// ignore_for_file: unnecessary_parenthesis
// ignore_for_file: camel_case_types
// ignore_for_file: subtype_of_sealed_class

/// A class which mocks [UserRepository].
///
/// See the documentation for Mockito's code generation for more information.
class MockUserRepository extends _i1.Mock implements _i2.UserRepository {
MockUserRepository() {
_i1.throwOnMissingStub(this);
}

@override
_i3.Future<_i4.User?> login(
String? username,
String? password,
) =>
(super.noSuchMethod(
Invocation.method(
#login,
[
username,
password,
],
),
returnValue: _i3.Future<_i4.User?>.value(),
) as _i3.Future<_i4.User?>);

@override
_i3.Future<bool> register(_i4.User? data) => (super.noSuchMethod(
Invocation.method(
#register,
[data],
),
returnValue: _i3.Future<bool>.value(false),
) as _i3.Future<bool>);
}
Loading

0 comments on commit 67a1ec8

Please sign in to comment.