forked from eatvio/eatvio_app
feat(dependencies): add rxdart package and improve string extension methods for better handling of empty strings and gender parsing
This commit is contained in:
30
test/features/settings/entities/settings_entity_test.dart
Normal file
30
test/features/settings/entities/settings_entity_test.dart
Normal file
@@ -0,0 +1,30 @@
|
||||
import 'package:eatvio_app/features/profile/models/profile_model.dart';
|
||||
import 'package:eatvio_app/features/settings/entities/settings_entity.dart';
|
||||
import 'package:eatvio_app/features/settings/models/profile_settings_model.dart';
|
||||
import 'package:eatvio_app/features/settings/presentation/bloc/settings_cubit/settings_cubit.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
import 'package:mockito/annotations.dart';
|
||||
|
||||
import 'settings_entity_test.mocks.dart';
|
||||
|
||||
@GenerateNiceMocks([MockSpec<ProfileSettingsModel>(), MockSpec<ProfileDetailsModel>(), MockSpec<SettingsCubit>()])
|
||||
void main() {
|
||||
group('SettingsEntity', () {
|
||||
test('создает SettingsEntity с правильными значениями', () {
|
||||
final mockSettings = MockProfileSettingsModel();
|
||||
final mockDetails = MockProfileDetailsModel();
|
||||
final mockCubit = MockSettingsCubit();
|
||||
|
||||
final entity = SettingsEntity(
|
||||
profileSettingsModel: mockSettings,
|
||||
profileDetailsModel: mockDetails,
|
||||
settingsCubit: mockCubit,
|
||||
);
|
||||
|
||||
expect(entity.profileSettingsModel, mockSettings);
|
||||
expect(entity.profileDetailsModel, mockDetails);
|
||||
expect(entity.settingsCubit, mockCubit);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
32
test/features/settings/models/oauth_attach_request_test.dart
Normal file
32
test/features/settings/models/oauth_attach_request_test.dart
Normal file
@@ -0,0 +1,32 @@
|
||||
import 'package:eatvio_app/features/settings/models/oauth_attach_request.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('OAuthAttachRequest', () {
|
||||
test('создает OAuthAttachRequest с правильными значениями', () {
|
||||
const model = OAuthAttachRequest(
|
||||
provider: 'yandex',
|
||||
clientId: 'client-123',
|
||||
accessToken: 'access-token',
|
||||
refreshToken: 'refresh-token',
|
||||
);
|
||||
|
||||
expect(model.provider, 'yandex');
|
||||
expect(model.clientId, 'client-123');
|
||||
expect(model.accessToken, 'access-token');
|
||||
expect(model.refreshToken, 'refresh-token');
|
||||
});
|
||||
|
||||
test('создает OAuthAttachRequest без clientId', () {
|
||||
const model = OAuthAttachRequest(
|
||||
provider: 'yandex',
|
||||
clientId: null,
|
||||
accessToken: 'access-token',
|
||||
refreshToken: 'refresh-token',
|
||||
);
|
||||
|
||||
expect(model.clientId, isNull);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user