Update generated files

This commit is contained in:
Roland Geider
2025-11-20 23:01:20 +01:00
parent fcc0b683d4
commit 5f61af3b66
10 changed files with 111 additions and 29 deletions

View File

@@ -40,7 +40,7 @@ final class GymStateNotifierProvider extends $NotifierProvider<GymStateNotifier,
}
}
String _$gymStateNotifierHash() => r'ee943c23a68e678830c65a0c53bfd609feb6bf62';
String _$gymStateNotifierHash() => r'449bd80d3b534f68af4f0dbb8556c7f093f3b918';
abstract class _$GymStateNotifier extends $Notifier<GymModeState> {
GymModeState build();

View File

@@ -760,6 +760,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i20.NutritionPlans
)
as _i18.Future<void>);
@override
_i18.Future<void> cacheIngredient(
_i13.Ingredient? ingredient, {
_i9.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#cacheIngredient,
[ingredient],
{#database: database},
),
returnValue: _i18.Future<void>.value(),
returnValueForMissingStub: _i18.Future<void>.value(),
)
as _i18.Future<void>);
@override
_i18.Future<_i13.Ingredient> fetchIngredient(
int? ingredientId, {

View File

@@ -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<String>(
this,
Invocation.getter(#gymModeShowExercises),
),
)
as String);
@override
String get gymModeShowTimer =>
(super.noSuchMethod(
Invocation.getter(#gymModeShowTimer),
returnValue: _i3.dummyValue<String>(
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<String>(
this,
Invocation.getter(#superset),
),
)
as String);
@override
String get setHasProgression =>
(super.noSuchMethod(

View File

@@ -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);
});
});
}
}

View File

@@ -277,6 +277,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
)
as _i9.Future<void>);
@override
_i9.Future<void> cacheIngredient(
_i7.Ingredient? ingredient, {
_i3.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#cacheIngredient,
[ingredient],
{#database: database},
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i7.Ingredient> fetchIngredient(
int? ingredientId, {

View File

@@ -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();

View File

@@ -277,6 +277,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i8.NutritionPlansP
)
as _i9.Future<void>);
@override
_i9.Future<void> cacheIngredient(
_i7.Ingredient? ingredient, {
_i3.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#cacheIngredient,
[ingredient],
{#database: database},
),
returnValue: _i9.Future<void>.value(),
returnValueForMissingStub: _i9.Future<void>.value(),
)
as _i9.Future<void>);
@override
_i9.Future<_i7.Ingredient> fetchIngredient(
int? ingredientId, {

View File

@@ -1,23 +1,5 @@
/*
* This file is part of wger Workout Manager <https://github.com/wger-project>.
* 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 <http://www.gnu.org/licenses/>.
*/
// 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

View File

@@ -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

View File

@@ -537,6 +537,22 @@ class MockNutritionPlansProvider extends _i1.Mock implements _i16.NutritionPlans
)
as _i11.Future<void>);
@override
_i11.Future<void> cacheIngredient(
_i9.Ingredient? ingredient, {
_i5.IngredientDatabase? database,
}) =>
(super.noSuchMethod(
Invocation.method(
#cacheIngredient,
[ingredient],
{#database: database},
),
returnValue: _i11.Future<void>.value(),
returnValueForMissingStub: _i11.Future<void>.value(),
)
as _i11.Future<void>);
@override
_i11.Future<_i9.Ingredient> fetchIngredient(
int? ingredientId, {