feat(diary): improve stability

This commit is contained in:
mso7nueh
2026-05-05 15:57:12 +03:00
parent 91c8300da7
commit 48af13e37c
7 changed files with 148 additions and 710 deletions

View File

@@ -1007,7 +1007,7 @@ void main() {
final result = await diaryCubit!.fetchDiaryV2(needLoading: false);
expect(result, true);
expect(result, false);
expect(diaryCubit!.state, isA<DiaryStateError>());
});
@@ -1049,7 +1049,7 @@ void main() {
verify(mockDiaryRepository.deletePhoto(photo: photo, diaryId: 1, mealId: 1)).called(1);
});
test('setSelectedDay - возвращает true даже если getDiary возвращает null', () async {
test('setSelectedDay - returns false and reverts day when getDiary returns null', () async {
diaryCubit = DiaryCubit(
diaryRepository: mockDiaryRepository,
glossaryRepository: mockGlossaryRepository,
@@ -1073,7 +1073,7 @@ void main() {
final result = await diaryCubit!.setSelectedDay(DateTime(2024, 1, 20));
// fetchDiaryV2 возвращает true когда getDiary() == null, так как эмитит состояние ошибки
expect(result, true);
expect(result, false);
expect(diaryCubit!.state, isA<DiaryStateError>());
});