fix: issue-1049, issue-1039, issue-1035, issue-1032, issue-995, issue-993

This commit is contained in:
misha
2026-08-26 08:42:47 +03:00
parent 6265e865e9
commit de7bf8dc19
22 changed files with 509 additions and 192 deletions

View File

@@ -110,6 +110,18 @@ void main() {
expect(recipesCubit!.state.errorMessage, isNull);
});
test('loadRecipesList - сбрасывает currentPage при повторной загрузке', () async {
recipesCubit = RecipesCubit(feedRepository: mockFeedRepository, recipeRepository: mockRecipeRepository, aboutRecipeRepository: mockAboutRecipeRepository);
when(mockFeedRepository.getRecipes(tags: anyNamed('tags'), query: anyNamed('query'))).thenAnswer((_) async => []);
when(mockRecipeRepository.getRecipesTags()).thenAnswer((_) async => []);
recipesCubit!.currentPage = 4;
await recipesCubit!.loadRecipesList();
expect(recipesCubit!.currentPage, 1);
});
test('updateTags - добавляет и удаляет теги', () {
recipesCubit = RecipesCubit(feedRepository: mockFeedRepository, recipeRepository: mockRecipeRepository, aboutRecipeRepository: mockAboutRecipeRepository);