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:
misha
2026-04-07 10:05:11 +03:00
parent b6b13b1db5
commit aac085def4
133 changed files with 2344 additions and 2456 deletions

View File

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

View File

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