forked from eatvio/eatvio_app
chore(version): update app version to 1.3.5+85 and improve test coverage reporting in CI
This commit is contained in:
130
test/core/constants/app_constants_test.dart
Normal file
130
test/core/constants/app_constants_test.dart
Normal file
@@ -0,0 +1,130 @@
|
||||
import 'package:eatvio_app/core/constants/app_constants.dart';
|
||||
import 'package:flutter_test/flutter_test.dart';
|
||||
|
||||
void main() {
|
||||
group('AppConstants', () {
|
||||
group('Sizes', () {
|
||||
test('has correct padding values', () {
|
||||
expect(AppConstants.defaultPadding, 16.0);
|
||||
expect(AppConstants.smallPadding, 8.0);
|
||||
expect(AppConstants.largePadding, 24.0);
|
||||
expect(AppConstants.extraLargePadding, 32.0);
|
||||
});
|
||||
|
||||
test('has correct border radius values', () {
|
||||
expect(AppConstants.defaultBorderRadius, 8.0);
|
||||
expect(AppConstants.smallBorderRadius, 4.0);
|
||||
expect(AppConstants.largeBorderRadius, 16.0);
|
||||
});
|
||||
|
||||
test('has correct button height values', () {
|
||||
expect(AppConstants.defaultButtonHeight, 48.0);
|
||||
expect(AppConstants.smallButtonHeight, 36.0);
|
||||
expect(AppConstants.largeButtonHeight, 56.0);
|
||||
});
|
||||
|
||||
test('has correct content width values', () {
|
||||
expect(AppConstants.maxContentWidth, 400.0);
|
||||
expect(AppConstants.minContentWidth, 280.0);
|
||||
});
|
||||
});
|
||||
|
||||
group('Animations', () {
|
||||
test('has correct animation durations', () {
|
||||
expect(AppConstants.defaultAnimationDuration, Duration(milliseconds: 300));
|
||||
expect(AppConstants.fastAnimationDuration, Duration(milliseconds: 150));
|
||||
expect(AppConstants.slowAnimationDuration, Duration(milliseconds: 500));
|
||||
});
|
||||
});
|
||||
|
||||
group('Timeouts', () {
|
||||
test('has correct timeout durations', () {
|
||||
expect(AppConstants.defaultTimeout, Duration(seconds: 30));
|
||||
expect(AppConstants.shortTimeout, Duration(seconds: 10));
|
||||
expect(AppConstants.longTimeout, Duration(minutes: 2));
|
||||
});
|
||||
});
|
||||
|
||||
group('Limits', () {
|
||||
test('has correct size limits', () {
|
||||
expect(AppConstants.maxImageSize, 5 * 1024 * 1024);
|
||||
expect(AppConstants.maxVideoSize, 100 * 1024 * 1024);
|
||||
});
|
||||
|
||||
test('has correct text length limits', () {
|
||||
expect(AppConstants.maxTextLength, 1000);
|
||||
expect(AppConstants.maxTitleLength, 100);
|
||||
expect(AppConstants.maxDescriptionLength, 500);
|
||||
});
|
||||
});
|
||||
|
||||
group('Pagination', () {
|
||||
test('has correct page sizes', () {
|
||||
expect(AppConstants.defaultPageSize, 20);
|
||||
expect(AppConstants.smallPageSize, 10);
|
||||
expect(AppConstants.largePageSize, 50);
|
||||
});
|
||||
});
|
||||
|
||||
group('Formats', () {
|
||||
test('has supported image formats', () {
|
||||
expect(AppConstants.supportedImageFormats, contains('jpg'));
|
||||
expect(AppConstants.supportedImageFormats, contains('jpeg'));
|
||||
expect(AppConstants.supportedImageFormats, contains('png'));
|
||||
expect(AppConstants.supportedImageFormats, contains('webp'));
|
||||
});
|
||||
|
||||
test('has supported video formats', () {
|
||||
expect(AppConstants.supportedVideoFormats, contains('mp4'));
|
||||
expect(AppConstants.supportedVideoFormats, contains('mov'));
|
||||
expect(AppConstants.supportedVideoFormats, contains('avi'));
|
||||
});
|
||||
});
|
||||
|
||||
group('Regex', () {
|
||||
test('has email regex', () {
|
||||
expect(AppConstants.emailRegex, isA<String>());
|
||||
expect(AppConstants.emailRegex.isNotEmpty, isTrue);
|
||||
});
|
||||
|
||||
test('has phone regex', () {
|
||||
expect(AppConstants.phoneRegex, isA<String>());
|
||||
expect(AppConstants.phoneRegex.isNotEmpty, isTrue);
|
||||
});
|
||||
|
||||
test('has URL regex', () {
|
||||
expect(AppConstants.urlRegex, isA<String>());
|
||||
expect(AppConstants.urlRegex.isNotEmpty, isTrue);
|
||||
});
|
||||
});
|
||||
|
||||
group('Messages', () {
|
||||
test('has error messages', () {
|
||||
expect(AppConstants.defaultErrorMessage, isA<String>());
|
||||
expect(AppConstants.networkErrorMessage, isA<String>());
|
||||
expect(AppConstants.timeoutErrorMessage, isA<String>());
|
||||
expect(AppConstants.unknownErrorMessage, isA<String>());
|
||||
});
|
||||
});
|
||||
|
||||
group('Keys', () {
|
||||
test('has SharedPreferences keys', () {
|
||||
expect(AppConstants.welcomeScreenShownKey, isA<String>());
|
||||
expect(AppConstants.userTokenKey, isA<String>());
|
||||
expect(AppConstants.userDataKey, isA<String>());
|
||||
expect(AppConstants.settingsKey, isA<String>());
|
||||
});
|
||||
});
|
||||
|
||||
group('API Endpoints', () {
|
||||
test('has API endpoints', () {
|
||||
expect(AppConstants.apiVersion, '/api');
|
||||
expect(AppConstants.authEndpoint, '/auth');
|
||||
expect(AppConstants.usersEndpoint, '/users');
|
||||
expect(AppConstants.postsEndpoint, '/posts');
|
||||
expect(AppConstants.commentsEndpoint, '/comments');
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user