forked from eatvio/eatvio_app
feat(app): refactoring of sentry using, feat(become_consultant): fixed possible infinite loading, feat(push_notifications): fixed push navigation from paid plan push
This commit is contained in:
@@ -139,13 +139,14 @@ void main() {
|
||||
expect(cubit.state.sheet.responseBody, '{"locations": ["London, UK"]}');
|
||||
});
|
||||
|
||||
test('getLocationsByQuery rethrows exception on error', () async {
|
||||
test('getLocationsByQuery returns empty list on error', () async {
|
||||
const query = 'Invalid';
|
||||
final exception = Exception('Network error');
|
||||
|
||||
when(() => mockRepository.getLocationsListByQuery(query)).thenThrow(exception);
|
||||
|
||||
expect(() => cubit.getLocationsByQuery(query), throwsException);
|
||||
final result = await cubit.getLocationsByQuery(query);
|
||||
expect(result, isEmpty);
|
||||
});
|
||||
|
||||
test('getLocationsByCoordinates returns list of locations', () async {
|
||||
@@ -176,14 +177,15 @@ void main() {
|
||||
expect(cubit.state.sheet.responseBody, '{"locations": ["London, UK"]}');
|
||||
});
|
||||
|
||||
test('getLocationsByCoordinates rethrows exception on error', () async {
|
||||
test('getLocationsByCoordinates returns empty list on error', () async {
|
||||
const latitude = 'invalid';
|
||||
const longitude = 'invalid';
|
||||
final exception = Exception('Invalid coordinates');
|
||||
|
||||
when(() => mockRepository.getLocationsListByCoordinates(latitude, longitude)).thenThrow(exception);
|
||||
|
||||
expect(() => cubit.getLocationsByCoordinates(latitude, longitude), throwsException);
|
||||
final result = await cubit.getLocationsByCoordinates(latitude, longitude);
|
||||
expect(result, isEmpty);
|
||||
});
|
||||
|
||||
test('getLocationsByQuery handles empty query', () async {
|
||||
|
||||
@@ -140,7 +140,7 @@ void main() {
|
||||
when(mockRepository.sendEmailCode())
|
||||
.thenAnswer((_) async => {});
|
||||
when(mockRepository.tryVerifyEmailByCode('wrong'))
|
||||
.thenAnswer((_) async => false);
|
||||
.thenThrow(Exception('Неверный код'));
|
||||
|
||||
await cubit!.sendEmailCode();
|
||||
await cubit!.tryVerify('wrong');
|
||||
|
||||
Reference in New Issue
Block a user