feat(tests): fixed tests

This commit is contained in:
misha
2026-05-28 12:11:29 +03:00
parent 9e9f2a9f45
commit 634d83fd61
4 changed files with 120 additions and 98 deletions

View File

@@ -1,9 +1,14 @@
import 'package:eatvio_app/core/app_config.dart';
import 'package:eatvio_app/core/app_initializer.dart';
import 'package:eatvio_app/core/env_config.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:eatvio_app/core/locator_service.dart';
import 'package:eatvio_app/features/video_calls/presentation/bloc/video_call_session/video_call_session_cubit.dart';
import 'package:flutter_bloc/flutter_bloc.dart';
import 'package:flutter_dotenv/flutter_dotenv.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:mockito/mockito.dart';
class _MockVideoCallSessionCubit extends Mock implements VideoCallSessionCubit {}
void main() {
setUpAll(() async {
@@ -11,6 +16,17 @@ void main() {
dotenv.loadFromString(envString: 'DEV_BASE_URL=http://localhost\nBASE_URL=http://localhost');
});
setUp(() async {
await sl.reset();
sl.registerLazySingleton<VideoCallSessionCubit>(
_MockVideoCallSessionCubit.new,
);
});
tearDown(() async {
await sl.reset();
});
group('AppConfig', () {
test('creates config with prod build type', () {
final config = AppConfig(buildType: AppBuildType.prod);