forked from eatvio/eatvio_app
feat(diary): improve stability
This commit is contained in:
@@ -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>());
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user