diff --git a/lib/providers/gym_state.g.dart b/lib/providers/gym_state.g.dart index 20e0bd05..3a858e5e 100644 --- a/lib/providers/gym_state.g.dart +++ b/lib/providers/gym_state.g.dart @@ -40,7 +40,7 @@ final class GymStateNotifierProvider extends $NotifierProvider r'ee943c23a68e678830c65a0c53bfd609feb6bf62'; +String _$gymStateNotifierHash() => r'449bd80d3b534f68af4f0dbb8556c7f093f3b918'; abstract class _$GymStateNotifier extends $Notifier { GymModeState build(); diff --git a/test/core/settings_test.mocks.dart b/test/core/settings_test.mocks.dart index 208aca6e..101d059e 100644 --- a/test/core/settings_test.mocks.dart +++ b/test/core/settings_test.mocks.dart @@ -760,6 +760,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i20.NutritionPlans ) as _i18.Future); + @override + _i18.Future cacheIngredient( + _i13.Ingredient? ingredient, { + _i9.IngredientDatabase? database, + }) => + (super.noSuchMethod( + Invocation.method( + #cacheIngredient, + [ingredient], + {#database: database}, + ), + returnValue: _i18.Future.value(), + returnValueForMissingStub: _i18.Future.value(), + ) + as _i18.Future); + @override _i18.Future<_i13.Ingredient> fetchIngredient( int? ingredientId, { diff --git a/test/core/validators_test.mocks.dart b/test/core/validators_test.mocks.dart index c563dc56..f78fcd69 100644 --- a/test/core/validators_test.mocks.dart +++ b/test/core/validators_test.mocks.dart @@ -1073,6 +1073,28 @@ class MockAppLocalizations extends _i1.Mock implements _i2.AppLocalizations { ) as String); + @override + String get gymModeShowExercises => + (super.noSuchMethod( + Invocation.getter(#gymModeShowExercises), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#gymModeShowExercises), + ), + ) + as String); + + @override + String get gymModeShowTimer => + (super.noSuchMethod( + Invocation.getter(#gymModeShowTimer), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#gymModeShowTimer), + ), + ) + as String); + @override String get plateCalculator => (super.noSuchMethod( @@ -2857,6 +2879,17 @@ class MockAppLocalizations extends _i1.Mock implements _i2.AppLocalizations { ) as String); + @override + String get superset => + (super.noSuchMethod( + Invocation.getter(#superset), + returnValue: _i3.dummyValue( + this, + Invocation.getter(#superset), + ), + ) + as String); + @override String get setHasProgression => (super.noSuchMethod( diff --git a/test/exercises/contribute_exercise_test.dart b/test/exercises/contribute_exercise_test.dart index bd84eced..a909efc0 100644 --- a/test/exercises/contribute_exercise_test.dart +++ b/test/exercises/contribute_exercise_test.dart @@ -23,7 +23,6 @@ import 'package:mockito/mockito.dart'; import 'package:provider/provider.dart'; import 'package:wger/exceptions/http_exception.dart'; import 'package:wger/l10n/generated/app_localizations.dart'; -import 'package:wger/models/exercises/exercise.dart'; import 'package:wger/providers/add_exercise.dart'; import 'package:wger/providers/exercises.dart'; import 'package:wger/providers/user.dart'; @@ -136,8 +135,8 @@ void main() { group('Form Field Validation Tests', () { testWidgets('Exercise name field is required and displays validation error', ( - WidgetTester tester, - ) async { + WidgetTester tester, + ) async { // Setup: Create verified user with required data setupFullVerifiedUserContext(); @@ -187,8 +186,8 @@ void main() { }); testWidgets('Alternative names field accepts multiple lines of text', ( - WidgetTester tester, - ) async { + WidgetTester tester, + ) async { // Setup: Create verified user setupFullVerifiedUserContext(); @@ -438,8 +437,8 @@ void main() { }); testWidgets('Provider clear method is called after successful submission', ( - WidgetTester tester, - ) async { + WidgetTester tester, + ) async { // Setup: Mock successful submission flow setupFullVerifiedUserContext(); when(mockAddExerciseProvider.postExerciseToServer()).thenAnswer((_) async => 1); @@ -518,4 +517,4 @@ void main() { expect(profileButton, findsOneWidget); }); }); -} \ No newline at end of file +} diff --git a/test/nutrition/nutritional_meal_form_test.mocks.dart b/test/nutrition/nutritional_meal_form_test.mocks.dart index 5354395b..bb520808 100644 --- a/test/nutrition/nutritional_meal_form_test.mocks.dart +++ b/test/nutrition/nutritional_meal_form_test.mocks.dart @@ -277,6 +277,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP ) as _i9.Future); + @override + _i9.Future cacheIngredient( + _i7.Ingredient? ingredient, { + _i3.IngredientDatabase? database, + }) => + (super.noSuchMethod( + Invocation.method( + #cacheIngredient, + [ingredient], + {#database: database}, + ), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); + @override _i9.Future<_i7.Ingredient> fetchIngredient( int? ingredientId, { diff --git a/test/nutrition/nutritional_meal_item_form_test.dart b/test/nutrition/nutritional_meal_item_form_test.dart index eb28f0b0..6531e145 100644 --- a/test/nutrition/nutritional_meal_item_form_test.dart +++ b/test/nutrition/nutritional_meal_item_form_test.dart @@ -348,6 +348,10 @@ void main() { ), ).thenAnswer((_) => Future.value([ingredient1])); + when( + mockNutrition.cacheIngredient(any), + ).thenAnswer((_) => Future.value(null)); + await tester.enterText(find.byType(TextFormField).first, 'Water'); await tester.pumpAndSettle(const Duration(milliseconds: 600)); await tester.pumpAndSettle(); diff --git a/test/nutrition/nutritional_plan_form_test.mocks.dart b/test/nutrition/nutritional_plan_form_test.mocks.dart index 5f854e56..3ad87456 100644 --- a/test/nutrition/nutritional_plan_form_test.mocks.dart +++ b/test/nutrition/nutritional_plan_form_test.mocks.dart @@ -277,6 +277,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP ) as _i9.Future); + @override + _i9.Future cacheIngredient( + _i7.Ingredient? ingredient, { + _i3.IngredientDatabase? database, + }) => + (super.noSuchMethod( + Invocation.method( + #cacheIngredient, + [ingredient], + {#database: database}, + ), + returnValue: _i9.Future.value(), + returnValueForMissingStub: _i9.Future.value(), + ) + as _i9.Future); + @override _i9.Future<_i7.Ingredient> fetchIngredient( int? ingredientId, { diff --git a/test/routine/gym_mode/gym_mode_test.mocks.dart b/test/routine/gym_mode/gym_mode_test.mocks.dart index b530e07e..f681d4ed 100644 --- a/test/routine/gym_mode/gym_mode_test.mocks.dart +++ b/test/routine/gym_mode/gym_mode_test.mocks.dart @@ -1,23 +1,5 @@ -/* - * This file is part of wger Workout Manager . - * Copyright (c) 2020, wger Team - * - * wger Workout Manager is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see . - */ - // Mocks generated by Mockito 5.4.6 from annotations -// in wger/test/routine/gym_mode_test.dart. +// in wger/test/routine/gym_mode/gym_mode_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/test/routine/gym_mode/session_page_test.mocks.dart b/test/routine/gym_mode/session_page_test.mocks.dart index 9f57c7c9..14c5d3a9 100644 --- a/test/routine/gym_mode/session_page_test.mocks.dart +++ b/test/routine/gym_mode/session_page_test.mocks.dart @@ -1,5 +1,5 @@ // Mocks generated by Mockito 5.4.6 from annotations -// in wger/test/routine/session_page_test.dart. +// in wger/test/routine/gym_mode/session_page_test.dart. // Do not manually edit this file. // ignore_for_file: no_leading_underscores_for_library_prefixes diff --git a/test/weight/weight_screen_test.mocks.dart b/test/weight/weight_screen_test.mocks.dart index 01eb7998..739fb741 100644 --- a/test/weight/weight_screen_test.mocks.dart +++ b/test/weight/weight_screen_test.mocks.dart @@ -537,6 +537,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i16.NutritionPlans ) as _i11.Future); + @override + _i11.Future cacheIngredient( + _i9.Ingredient? ingredient, { + _i5.IngredientDatabase? database, + }) => + (super.noSuchMethod( + Invocation.method( + #cacheIngredient, + [ingredient], + {#database: database}, + ), + returnValue: _i11.Future.value(), + returnValueForMissingStub: _i11.Future.value(), + ) + as _i11.Future); + @override _i11.Future<_i9.Ingredient> fetchIngredient( int? ingredientId, {